Browse Source

🐞 fix: 已修复用户不再修复

Pchen. 1 month ago
parent
commit
1bf3f1cfe1
1 changed files with 9 additions and 0 deletions
  1. 9 0
      lib/Lepao/Lepao.js

+ 9 - 0
lib/Lepao/Lepao.js

@@ -377,6 +377,15 @@ class Lepao {
     // 修复3.12~3.18期间未入库记录
     // 修复3.12~3.18期间未入库记录
     async fixRecords(uuid, reqData) {
     async fixRecords(uuid, reqData) {
         try {
         try {
+            //已开始乐跑,存入Redis
+            const isFix = await Redis.get(`fixRecord:${reqData.student_id}`)
+            if (isFix) {
+                this.logger.info(`${reqData.student_id}已存在修复记录,跳过修复流程`)
+                return
+            }
+
+            await Redis.set(`fixRecord:${reqData.student_id}`, reqData.student_id)
+
             const countUrl = this.runpy + '/get_term_record'
             const countUrl = this.runpy + '/get_term_record'
 
 
             const recordRes = await axios.post(countUrl, reqData)
             const recordRes = await axios.post(countUrl, reqData)