File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,11 @@ export class Actor<Data extends Dictionary = Dictionary> {
81
81
*/
82
82
private warnedAboutMissingInitCall = false ;
83
83
84
+ /**
85
+ * Set if the Actor is currently rebooting.
86
+ */
87
+ private isRebooting = false ;
88
+
84
89
constructor ( options : ConfigurationOptions = { } ) {
85
90
// use default configuration object if nothing overridden (it fallbacks to env vars)
86
91
this . config = Object . keys ( options ) . length === 0 ? Configuration . getGlobalConfig ( ) : new Configuration ( options ) ;
@@ -459,6 +464,13 @@ export class Actor<Data extends Dictionary = Dictionary> {
459
464
return ;
460
465
}
461
466
467
+ if ( this . isRebooting ) {
468
+ log . debug ( 'Actor is already rebooting, skipping the additional reboot call.' ) ;
469
+ return ;
470
+ }
471
+
472
+ this . isRebooting = true ;
473
+
462
474
// Waiting for all the listeners to finish, as `.reboot()` kills the container.
463
475
await Promise . all ( [
464
476
// `persistState` for individual RequestLists, RequestQueue... instances to be persisted
You can’t perform that action at this time.
0 commit comments