File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 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> {
8181 */
8282 private warnedAboutMissingInitCall = false ;
8383
84+ /**
85+ * Set if the Actor is currently rebooting.
86+ */
87+ private isRebooting = false ;
88+
8489 constructor ( options : ConfigurationOptions = { } ) {
8590 // use default configuration object if nothing overridden (it fallbacks to env vars)
8691 this . config = Object . keys ( options ) . length === 0 ? Configuration . getGlobalConfig ( ) : new Configuration ( options ) ;
@@ -459,6 +464,13 @@ export class Actor<Data extends Dictionary = Dictionary> {
459464 return ;
460465 }
461466
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+
462474 // Waiting for all the listeners to finish, as `.reboot()` kills the container.
463475 await Promise . all ( [
464476 // `persistState` for individual RequestLists, RequestQueue... instances to be persisted
You can’t perform that action at this time.
0 commit comments