mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-25 16:36: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_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) => {
|
||||
this.cronDb.update(
|
||||
{ _id: { $in: ids } },
|
||||
{
|
||||
$set: {
|
||||
status,
|
||||
pid,
|
||||
log_path,
|
||||
last_running_time,
|
||||
last_execution_time,
|
||||
},
|
||||
$set: options,
|
||||
},
|
||||
{ multi: true, returnUpdatedDocs: true },
|
||||
(err) => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user