mirror of
https://github.com/whyour/qinglong.git
synced 2026-06-30 20:35:09 +08:00
初始化保存一次session和cron数据
This commit is contained in:
@@ -2,6 +2,7 @@ import { exec } from 'child_process';
|
||||
import { Container } from 'typedi';
|
||||
import { Crontab, CrontabStatus } from '../data/cron';
|
||||
import CronService from '../services/cron';
|
||||
import CookieService from '../services/cookie';
|
||||
|
||||
const initData = [
|
||||
{
|
||||
@@ -29,6 +30,7 @@ const initData = [
|
||||
|
||||
export default async () => {
|
||||
const cronService = Container.get(CronService);
|
||||
const cookieService = Container.get(CookieService);
|
||||
const cronDb = cronService.getDb();
|
||||
|
||||
cronDb.count({}, async (err, count) => {
|
||||
@@ -71,6 +73,10 @@ export default async () => {
|
||||
exec(doc.command);
|
||||
}
|
||||
});
|
||||
|
||||
// 初始化保存一次ck和定时任务数据
|
||||
await cronService.autosave_crontab();
|
||||
await cookieService.set_cookies();
|
||||
};
|
||||
|
||||
function randomSchedule(from: number, to: number) {
|
||||
|
||||
Reference in New Issue
Block a user