修复最后运行时长被覆盖

This commit is contained in:
whyour 2021-11-29 21:49:32 +08:00
parent a28ed9281e
commit 9ddf6986e4

View File

@ -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) => {