guoziyun 8 달 전
부모
커밋
8a9af91029
4개의 변경된 파일19개의 추가작업 그리고 6개의 파일을 삭제
  1. 6 1
      oms/dist/services/ingestor-service.js
  2. 4 2
      oms/dist/src/scripts/run-tip-count.js
  3. 7 1
      oms/services/ingestor-service.ts
  4. 2 2
      oms/src/scripts/run-tip-count.ts

+ 6 - 1
oms/dist/services/ingestor-service.js

@@ -332,7 +332,12 @@ async function processMessage(msg) {
         // --- 3. Prepare User Data for MongoDB Batch Update ---
         // userSetData will contain fields to be updated using $set for both new and existing documents.
         // 'project' is now excluded here as it will be handled by $setOnInsert only.
-        const userSetData = { lastActiveAt: lastActiveAtDateObj };
+        //const userSetData: Partial<IUser> = { lastActiveAt: lastActiveAtDateObj };
+        const userSetData = {};
+        // 👇 关键修改:仅当事件类型不是 message_receive 时,才更新 lastActiveAt
+        if (eventType !== "message_receive") {
+            userSetData.lastActiveAt = lastActiveAtDateObj;
+        }
         // SetOnInsert fields will only apply when a new document is created
         const setOnInsertFields = {
             uid: uid,

+ 4 - 2
oms/dist/src/scripts/run-tip-count.js

@@ -1,10 +1,12 @@
 "use strict";
 Object.defineProperty(exports, "__esModule", { value: true });
+const backfill_done_rate_tip_count_1 = require("./backfill-done-rate-tip-count");
 const initialize_tip_count_1 = require("./initialize-tip-count");
+const recalculate_total_done_rate_1 = require("./recalculate-total-done-rate");
 async function run() {
     await (0, initialize_tip_count_1.runInitialization)();
-    // await runBackfill();
-    // await runRecalculation();
+    await (0, backfill_done_rate_tip_count_1.runBackfill)();
+    await (0, recalculate_total_done_rate_1.runRecalculation)();
 }
 if (require.main === module) {
     run().catch((err) => {

+ 7 - 1
oms/services/ingestor-service.ts

@@ -316,7 +316,13 @@ async function processMessage(msg: Message) {
     // --- 3. Prepare User Data for MongoDB Batch Update ---
     // userSetData will contain fields to be updated using $set for both new and existing documents.
     // 'project' is now excluded here as it will be handled by $setOnInsert only.
-    const userSetData: Partial<IUser> = { lastActiveAt: lastActiveAtDateObj };
+    //const userSetData: Partial<IUser> = { lastActiveAt: lastActiveAtDateObj };
+    const userSetData: Partial<IUser> = {};
+
+    // 👇 关键修改:仅当事件类型不是 message_receive 时,才更新 lastActiveAt
+    if (eventType !== "message_receive") {
+      userSetData.lastActiveAt = lastActiveAtDateObj;
+    }
 
     // SetOnInsert fields will only apply when a new document is created
     const setOnInsertFields: any = {

+ 2 - 2
oms/src/scripts/run-tip-count.ts

@@ -4,8 +4,8 @@ import { runRecalculation } from "./recalculate-total-done-rate";
 
 async function run() {
   await runInitialization();
-  // await runBackfill();
-  // await runRecalculation();
+  await runBackfill();
+  await runRecalculation();
 }
 
 if (require.main === module) {