Skip to content

Commit

Permalink
stop instead of restart (#1966)
Browse files Browse the repository at this point in the history
  • Loading branch information
rogeralsing authored Apr 4, 2023
1 parent 9736e45 commit d2ed63b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Proto.Actor/Context/ActorContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,13 @@ private IActor IncarnateActor()

private async ValueTask HandleRestartAsync()
{
//restart invoked but system is stopping. stop the actor
if (System.Shutdown.IsCancellationRequested)
{
await HandleStopAsync();
return;
}

_state = ContextState.Restarting;
CancelReceiveTimeout();
await InvokeUserMessageAsync(Restarting.Instance).ConfigureAwait(false);
Expand Down

0 comments on commit d2ed63b

Please sign in to comment.