core: also disable smtp if smtp.user doesn't exist

This commit is contained in:
undefined committed 2021-06-29 23:59:36 +08:00
1 parent bc4d424abf
commit cd4ada0845
3 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -116,7 +116,7 @@ class TaskModel {
static getFirst = getFirst;
static async getDelay(query?: FilterQuery<Task>) {
static async getDelay(query?: FilterQuery<Task>): Promise<[number, Date]> {
const now = new Date();
const res = await coll.findOne(query, { sort: { executeAfter: 1 } });
if (res) return [Math.max(0, now.getTime() - res.executeAfter.getTime()), res.executeAfter];