File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -472,6 +472,7 @@ class Actions {
472472 activeJobs : this . getActiveJobs ( ) ,
473473 jobsChanged : true
474474 } ) ;
475+ this . masterSync ( ) ;
475476
476477 if ( ! action . details ) action . details = "" ;
477478
Original file line number Diff line number Diff line change @@ -835,6 +835,7 @@ class Jobs {
835835 activeJobs : self . getActiveJobs ( ) ,
836836 jobsChanged : true
837837 } ) ;
838+ self . masterSync ( ) ;
838839 } ) ; // loadSession
839840 }
840841
@@ -950,6 +951,7 @@ class Jobs {
950951 activeJobs : self . getActiveJobs ( ) ,
951952 jobsChanged : true
952953 } ) ;
954+ self . masterSync ( ) ;
953955
954956 } ) ; // loadSession
955957 }
Original file line number Diff line number Diff line change @@ -216,6 +216,7 @@ class Jobs {
216216 activeJobs : this . getActiveJobs ( ) ,
217217 jobsChanged : true
218218 } ) ;
219+ this . masterSync ( ) ;
219220 }
220221
221222 appendJobLog ( job , msg , data ) {
@@ -311,6 +312,7 @@ class Jobs {
311312 activeJobs : this . getActiveJobs ( ) ,
312313 jobsChanged : true
313314 } ) ;
315+ this . masterSync ( ) ;
314316 }
315317
316318 // FUTURE NOTE: This will only launch a max of 1 queued job per event per second (per tick)
@@ -1278,6 +1280,7 @@ class Jobs {
12781280 jobsChanged : true ,
12791281 state : Tools . copyHashRemoveKeys ( self . state , { dirty : 1 } )
12801282 } ) ;
1283+ self . masterSync ( ) ;
12811284
12821285 // and notify all job watchers that the job is fully complete
12831286 self . doPageBroadcast ( 'Job?id=' + job . id , 'job_completed' , { } ) ;
Original file line number Diff line number Diff line change @@ -976,8 +976,8 @@ class Multi {
976976 this . electionTimer = setTimeout ( this . electMaster . bind ( this ) , multi . master_timeout_sec * 1000 ) ;
977977 }
978978
979- masterTick ( ) {
980- // called every second, maintain master peers
979+ masterSync ( ) {
980+ // sync all active data with peers
981981 var self = this ;
982982 if ( ! this . master ) return ;
983983
@@ -990,7 +990,18 @@ class Multi {
990990 jobDetails : self . jobDetails ,
991991 activeAlerts : self . activeAlerts
992992 } ) ;
993- peer . socket . tick ( ) ;
993+ } ) ;
994+ }
995+
996+ masterTick ( ) {
997+ // called every second, maintain master peers
998+ var self = this ;
999+ if ( ! this . master ) return ;
1000+
1001+ this . masterSync ( ) ;
1002+
1003+ this . peers . forEach ( function ( peer ) {
1004+ if ( peer . socket ) peer . socket . tick ( ) ;
9941005 } ) ;
9951006 }
9961007
You can’t perform that action at this time.
0 commit comments