-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure
LocalNode
to be stoped before shutting down the NeoSystem
- Loading branch information
Showing
1 changed file
with
10 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
using Neo.Wallets; | ||
using System; | ||
using System.Net; | ||
using System.Threading; | ||
|
||
namespace Neo | ||
{ | ||
|
@@ -40,10 +41,18 @@ public NeoSystem(Store store) | |
public void Dispose() | ||
{ | ||
RpcServer?.Dispose(); | ||
ActorSystem.Stop(LocalNode); | ||
EnsureStoped(LocalNode); | ||
ActorSystem.Dispose(); | ||
} | ||
|
||
public void EnsureStoped(IActorRef actor) | ||
{ | ||
Inbox inbox = Inbox.Create(ActorSystem); | ||
inbox.Watch(actor); | ||
ActorSystem.Stop(actor); | ||
inbox.Receive(Timeout.InfiniteTimeSpan); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jsolman
Contributor
|
||
} | ||
|
||
internal void ResumeNodeStartup() | ||
{ | ||
suspend = false; | ||
|
This may not be working, or perhaps we need to try catch around this. It’s throwing
System.TimeoutException: Inbox akka://NeoSystem/system/inbox-1 received a status failure response message: Deadline passed ---> System.TimeoutException: Deadline passed