Add auto pull
This commit is contained in:
@ -1,18 +1,12 @@
|
|||||||
import { CronJob } from 'cron';
|
import { CronJob } from 'cron';
|
||||||
|
import { pullData } from './lib/united.js';
|
||||||
|
|
||||||
/*
|
|
||||||
const job = new CronJob(
|
const job = new CronJob(
|
||||||
'10 0 * * * *', // cronTime
|
'0,30 * * * *', // cronTime
|
||||||
async function () {
|
async function () {
|
||||||
const startDate = Math.floor(
|
pullData(20);
|
||||||
new Date(new Date().getFullYear(), new Date().getMonth()).getTime() / 1000
|
|
||||||
);
|
|
||||||
const res = await fetchAccounts(startDate);
|
|
||||||
await updateAccounts(res);
|
|
||||||
await runRules();
|
|
||||||
}, // onTick
|
}, // onTick
|
||||||
null, // onComplete
|
null, // onComplete
|
||||||
true, // start
|
true, // start
|
||||||
'America/Detroit' // timeZone
|
'America/Detroit' // timeZone
|
||||||
);
|
);
|
||||||
*/
|
|
||||||
|
|||||||
Reference in New Issue
Block a user