guoziyun 9 mesi fa
parent
commit
79ab774b0e

+ 1 - 1
oms/dist/services/cron-jobs/index.js

@@ -20,7 +20,7 @@ const settings = [
     // ["daily-notify-at-midday", "0 23 * * *", require("./notify/daily-notify-at-midday") as CronJobModule], // 每天晚上11点,对应巴西时间中午12点推送一轮
     // ["daily-notify-at-evening", "0 3 * * *", require("./notify/daily-notify-at-evening") as CronJobModule], // 每天凌晨3点,对应巴西时间下午4点
     // ["daily-notify-at-afternoon", "0 7 * * *", require("./notify/daily-notify-at-afternoon") as CronJobModule], // 每天上午7点,对应巴西时间晚上8点
-    ["local-timezone-notify", "0 18 * * *", require("./notify/local-timezone-notify")], // 每天下午6点,开始制定当天的推送计划
+    ["local-timezone-notify", "30 18 * * *", require("./notify/local-timezone-notify")], // 每天下午6点,开始制定当天的推送计划
 ];
 /**
  * Starts all scheduled cron jobs.

+ 2 - 1
oms/dist/services/cron-jobs/notify/local-timezone-notify.js

@@ -134,7 +134,8 @@ async function run() {
     try {
         const sevenDaysAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000);
         const activeUsers = await userModel_1.User.find({
-            lastActiveAt: { $gte: sevenDaysAgo },
+            // lastActiveAt: { $gte: sevenDaysAgo },
+            $or: [{ lastActiveAt: { $gte: sevenDaysAgo } }, { lastActiveAt: { $in: [null, "", undefined] } }],
             fmToken: { $nin: [null, ""] },
             versionCode: { $gte: 347 },
         })

+ 1 - 1
oms/services/cron-jobs/index.ts

@@ -22,7 +22,7 @@ const settings: [string, string, CronJobModule][] = [
   // ["daily-notify-at-midday", "0 23 * * *", require("./notify/daily-notify-at-midday") as CronJobModule], // 每天晚上11点,对应巴西时间中午12点推送一轮
   // ["daily-notify-at-evening", "0 3 * * *", require("./notify/daily-notify-at-evening") as CronJobModule], // 每天凌晨3点,对应巴西时间下午4点
   // ["daily-notify-at-afternoon", "0 7 * * *", require("./notify/daily-notify-at-afternoon") as CronJobModule], // 每天上午7点,对应巴西时间晚上8点
-  ["local-timezone-notify", "0 18 * * *", require("./notify/local-timezone-notify") as CronJobModule], // 每天下午6点,开始制定当天的推送计划
+  ["local-timezone-notify", "30 18 * * *", require("./notify/local-timezone-notify") as CronJobModule], // 每天下午6点,开始制定当天的推送计划
 ];
 
 /**

+ 2 - 1
oms/services/cron-jobs/notify/local-timezone-notify.ts

@@ -147,7 +147,8 @@ export async function run(): Promise<void> {
     const sevenDaysAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000);
 
     const activeUsers = await User.find({
-      lastActiveAt: { $gte: sevenDaysAgo },
+      // lastActiveAt: { $gte: sevenDaysAgo },
+      $or: [{ lastActiveAt: { $gte: sevenDaysAgo } }, { lastActiveAt: { $in: [null, "", undefined] } }],
       fmToken: { $nin: [null, ""] },
       versionCode: { $gte: 347 },
     })