This repository was archived by the owner on Oct 18, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -109,10 +109,14 @@ class NativePHP {
109
109
if ( ( ( _a = nativePHPConfig === null || nativePHPConfig === void 0 ? void 0 : nativePHPConfig . updater ) === null || _a === void 0 ? void 0 : _a . enabled ) === true ) {
110
110
electron_updater_1 . autoUpdater . checkForUpdatesAndNotify ( ) ;
111
111
}
112
- schedulerInterval = setInterval ( ( ) => {
113
- console . log ( "Running scheduler..." ) ;
114
- ( 0 , server_1 . runScheduler ) ( apiPort . port ) ;
115
- } , 60 * 1000 ) ;
112
+ let now = new Date ( ) ;
113
+ let delay = ( 60 - now . getSeconds ( ) ) * 1000 + ( 1000 - now . getMilliseconds ( ) ) ;
114
+ setTimeout ( ( ) => {
115
+ schedulerInterval = setInterval ( ( ) => {
116
+ console . log ( "Running scheduler..." ) ;
117
+ ( 0 , server_1 . runScheduler ) ( apiPort . port ) ;
118
+ } , 60 * 1000 ) ;
119
+ } , delay ) ;
116
120
app . on ( 'activate' , function ( event , hasVisibleWindows ) {
117
121
if ( ! hasVisibleWindows ) {
118
122
( 0 , utils_2 . notifyLaravel ) ( 'booted' ) ;
Original file line number Diff line number Diff line change @@ -127,10 +127,15 @@ class NativePHP {
127
127
autoUpdater . checkForUpdatesAndNotify ( )
128
128
}
129
129
130
- schedulerInterval = setInterval ( ( ) => {
131
- console . log ( "Running scheduler..." )
132
- runScheduler ( apiPort . port ) ;
133
- } , 60 * 1000 ) ;
130
+ let now = new Date ( ) ;
131
+ let delay = ( 60 - now . getSeconds ( ) ) * 1000 + ( 1000 - now . getMilliseconds ( ) ) ;
132
+
133
+ setTimeout ( ( ) => {
134
+ schedulerInterval = setInterval ( ( ) => {
135
+ console . log ( "Running scheduler..." )
136
+ runScheduler ( apiPort . port ) ;
137
+ } , 60 * 1000 ) ;
138
+ } , delay ) ;
134
139
135
140
app . on ( 'activate' , function ( event , hasVisibleWindows ) {
136
141
// On macOS it's common to re-create a window in the app when the
You can’t perform that action at this time.
0 commit comments