mirror of
https://github.com/whyour/qinglong.git
synced 2025-07-07 20:06:08 +08:00
修复初始化任务状态
This commit is contained in:
parent
66266fd545
commit
9d8c592e69
|
@ -47,19 +47,21 @@ export default async () => {
|
||||||
|
|
||||||
// 初始化更新所有任务状态为空闲
|
// 初始化更新所有任务状态为空闲
|
||||||
cronDb.update(
|
cronDb.update(
|
||||||
{ status: CrontabStatus.running },
|
{ status: { $in: [CrontabStatus.running, CrontabStatus.queued] } },
|
||||||
{ $set: { status: CrontabStatus.idle } },
|
{ $set: { status: CrontabStatus.idle } },
|
||||||
|
{ multi: true },
|
||||||
);
|
);
|
||||||
|
|
||||||
// 初始化时执行一次所有的ql repo 任务
|
// 初始化时执行一次所有的ql repo 任务
|
||||||
cronDb
|
cronDb
|
||||||
.find({
|
.find({
|
||||||
command: /ql (repo|raw)/,
|
command: /ql (repo|raw)/,
|
||||||
|
isDisabled: { $ne: 1 },
|
||||||
})
|
})
|
||||||
.exec((err, docs) => {
|
.exec((err, docs) => {
|
||||||
for (let i = 0; i < docs.length; i++) {
|
for (let i = 0; i < docs.length; i++) {
|
||||||
const doc = docs[i];
|
const doc = docs[i];
|
||||||
if (doc && doc.isDisabled !== 1) {
|
if (doc) {
|
||||||
exec(doc.command);
|
exec(doc.command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user