File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
js/botasaurus-server-js/src Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -508,9 +508,9 @@ export class WorkerExecutor extends TaskExecutor {
508508 private setupGracefulShutdown ( ) : void {
509509 const shutdownHandler = async ( signal : string ) => {
510510 if ( this . isShuttingDown ) return ;
511+ this . isShuttingDown = true ;
511512
512513 console . log ( `[Worker] Received ${ signal } , initiating graceful shutdown...` ) ;
513- this . isShuttingDown = true ;
514514
515515 // Immediately notify master about in-progress tasks
516516 if ( this . inProgressTaskIds . size > 0 ) {
@@ -520,6 +520,8 @@ export class WorkerExecutor extends TaskExecutor {
520520 } catch ( error ) {
521521 console . warn ( '[Worker] Failed to notify master of shutdown, tasks will recover via visibility timeout:' , error ) ;
522522 }
523+ } else {
524+ console . log ( '[Worker] No in-progress tasks to release' ) ;
523525 }
524526 } ;
525527
You can’t perform that action at this time.
0 commit comments