fuyu 4 lat temu
rodzic
commit
c152bdfa5f
2 zmienionych plików z 6 dodań i 6 usunięć
  1. 4 4
      src/service/log.js
  2. 2 2
      src/service/move.js

+ 4 - 4
src/service/log.js

@@ -2,18 +2,18 @@
  * @Author: fuyu
  * @Date: 2021-03-23 16:25:59
  * @LastEditors: fuyu
- * @LastEditTime: 2021-03-28 22:24:17
+ * @LastEditTime: 2021-03-28 22:26:02
  * @FilePath: /sql_merge/src/service/log.js
  */
 const fs = require('fs')
 const path = require('path');
 const rootPath = path.join(__dirname, '..', '..', 'logs')
 import {getNowDay, getNowTime} from './time'
-export async function logSum(institution_id, count) {
+export async function logSum(institution_id, count, ) {
   if(institution_id instanceof Array) {
     institution_id = 'all'
   }
-  const dirPath = path.join(rootPath, 'sum')
+  const dirPath = path.join(rootPath, 'sum', prefix = '')
   checkPath(dirPath)
   const filePath = path.join(dirPath, getNowDay() + '.log')
   const time = getNowTime()
@@ -21,7 +21,7 @@ export async function logSum(institution_id, count) {
     time: time, institution_id, count,
   }
   fs.appendFileSync(filePath, JSON.stringify(obj) + '\r\n')
-  fs.writeFileSync(path.join(dirPath, institution_id + '-' + getNowDay() + '.log'), count + '')
+  fs.writeFileSync(path.join(dirPath, prefix + institution_id + '-' + getNowDay() + '.log'), count + '')
 }
 export async function logSingle(name) {
   checkPath(rootPath)

+ 2 - 2
src/service/move.js

@@ -2,7 +2,7 @@
  * @Author: fuyu
  * @Date: 2021-03-23 12:00:09
  * @LastEditors: fuyu
- * @LastEditTime: 2021-03-28 22:22:23
+ * @LastEditTime: 2021-03-28 22:25:22
  * @FilePath: /sql_merge/src/service/move.js
  */
 
@@ -53,7 +53,7 @@ const moveSinglePacs = async (institution_id, offset = 0) => {
     count = await moveExamsPacs(institution_id, offset)
     sum += count
   }
-  logSum('pacs-' + institution_id, sum)
+  logSum(institution_id, sum, 'pacs-')
 }
 
 const moveExamsPacs = async (institution_id, offset) => {