mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-26 00:46:07 +08:00
修复最后运行时长被覆盖
This commit is contained in:
parent
a28ed9281e
commit
9ddf6986e4
|
@ -93,17 +93,21 @@ export default class CronService {
|
||||||
last_running_time: number;
|
last_running_time: number;
|
||||||
last_execution_time: number;
|
last_execution_time: number;
|
||||||
}) {
|
}) {
|
||||||
|
const options: any = {
|
||||||
|
status,
|
||||||
|
pid,
|
||||||
|
log_path,
|
||||||
|
last_execution_time,
|
||||||
|
};
|
||||||
|
if (last_running_time > 0) {
|
||||||
|
options.last_running_time = last_running_time;
|
||||||
|
}
|
||||||
|
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
this.cronDb.update(
|
this.cronDb.update(
|
||||||
{ _id: { $in: ids } },
|
{ _id: { $in: ids } },
|
||||||
{
|
{
|
||||||
$set: {
|
$set: options,
|
||||||
status,
|
|
||||||
pid,
|
|
||||||
log_path,
|
|
||||||
last_running_time,
|
|
||||||
last_execution_time,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{ multi: true, returnUpdatedDocs: true },
|
{ multi: true, returnUpdatedDocs: true },
|
||||||
(err) => {
|
(err) => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user