Skip to content

Commit

Permalink
vc reconnects
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-jmattson committed Oct 13, 2021
1 parent 626b908 commit 6c4f014
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/TopoMojo.Api/Features/Template/TemplateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public async Task CheckHealth(string id)
var template = await GetDeployableTemplate(id);
var vm = await _pod.Refresh(template);
if (vm.Status == "created") // healthy is 'initialized' for existing template
throw new Exception("bad health");
throw new Exception("unhealthy");
}
}
}
6 changes: 6 additions & 0 deletions src/TopoMojo.Hypervisor/vSphere/VimClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1278,10 +1278,16 @@ private async Task MonitorSession()
catch (Exception ex)
{
_logger.LogError(0, ex, $"Failed to refresh cache for {_config.Host}");

if (ex.GetType().Name.Contains("ServerTooBusy"))
await Disconnect();
}
finally
{
await Task.Delay(_syncInterval);

if (_vim == null)
await Connect();
}
}
// _logger.LogDebug("sessionMonitor ended.");
Expand Down

0 comments on commit 6c4f014

Please sign in to comment.