Skip to content

Commit d3bbac0

Browse files
committed
Move Task run out of catch
1 parent bb71d1a commit d3bbac0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

LiveControlGateway/LifetimeManager/HubLifetime.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,18 @@ public async Task<bool> InitAsync(CancellationToken cancellationToken)
8787
{
8888
await using var db = await _dbContextFactory.CreateDbContextAsync(cancellationToken);
8989
await UpdateShockers(db, cancellationToken);
90-
#pragma warning disable CS4014
91-
LucTask.Run(UpdateLoop);
92-
#pragma warning restore CS4014
9390
}
9491
catch (Exception e)
9592
{
93+
// (╯°□°)╯︵ ┻━┻
9694
_logger.LogError(e, "Error initializing OpenShock Hub lifetime");
9795
return false;
9896
}
9997

98+
#pragma warning disable CS4014
99+
LucTask.Run(UpdateLoop);
100+
#pragma warning restore CS4014
101+
100102
_state = HubLifetimeState.Idle; // We are fully setup, we can go back to idle state
101103
return true;
102104
}

0 commit comments

Comments
 (0)