mirror of
https://github.com/wownero/cyberwow.git
synced 2026-12-03 13:43:59 +01:00
detect exiting in proper loop
This commit is contained in:
+10
-7
@@ -235,13 +235,6 @@ class SyncedState extends HookedState {
|
||||
await for (final line in processOutput) {
|
||||
if (!synced) break;
|
||||
|
||||
if (isExiting()) {
|
||||
ExitingState _next = ExitingState
|
||||
(
|
||||
setState, getNotification, stdout, processOutput
|
||||
);
|
||||
return moveState(_next);
|
||||
}
|
||||
// print('synced: print stdout loop');
|
||||
stdout.addLast(line);
|
||||
log.info(line);
|
||||
@@ -252,6 +245,16 @@ class SyncedState extends HookedState {
|
||||
|
||||
Future<void> checkSync() async {
|
||||
await for (final _null in refresh.pull(getNotification, 'syncedState')) {
|
||||
if (isExiting()) {
|
||||
log.fine('Synced state detected exiting');
|
||||
|
||||
ExitingState _next = ExitingState
|
||||
(
|
||||
setState, getNotification, stdout, processOutput
|
||||
);
|
||||
return moveState(_next);
|
||||
}
|
||||
|
||||
if (await daemon.isNotSynced()) {
|
||||
synced = false;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user