File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -220,12 +220,14 @@ export function registerJobs() {
220220 // });
221221 } ) ;
222222
223- while ( true ) {
224- const minuteCronStart = performance . now ( ) ;
225- track ( "job-sync" ) ;
226- // Loop through users.
227- app . logger . info ( "SELECTING..." ) ;
228- sql `select * from users where clan_id is not null;` . then ( async ( users ) => {
223+ ( async function ( ) {
224+ while ( true ) {
225+ const minuteCronStart = performance . now ( ) ;
226+ track ( "job-sync" ) ;
227+ // Loop through users.
228+ app . logger . info ( "SELECTING..." ) ;
229+ const users = await sql `select * from users where clan_id is not null;` ;
230+
229231 users . forEach ( async ( user ) => {
230232 for (
231233 let date = eventStartDate ;
@@ -261,6 +263,6 @@ export function registerJobs() {
261263 text : `sync job took ${ performance . now ( ) - minuteCronStart } ms` ,
262264 channel : "U03DFNYGPCN" , // @Malted
263265 } ) ;
264- } ) ;
265- }
266+ }
267+ } ) ( ) ;
266268}
You can’t perform that action at this time.
0 commit comments