guhongwei vor 3 Jahren
Ursprung
Commit
0be0056dcc
2 geänderte Dateien mit 16 neuen und 16 gelöschten Zeilen
  1. 1 1
      app/schedule/patentearly.js
  2. 15 15
      app/service/patent/patentinfo.js

+ 1 - 1
app/schedule/patentearly.js

@@ -4,7 +4,7 @@ module.exports = {
     // interval: '30s', // 1 分钟间隔
     // cron: '0 0 10 * * *',//每天上午十点
     // cron: '0 10 10 ? * *', // 每天上午十点十分
-    cron: '0 0-6 14 * * ?', // 每天下午零六
+    cron: '30 * * * * ?', // 30s
     type: 'worker', // 指定所有的 worker 都需要执行
   },
   async task(ctx) {

+ 15 - 15
app/service/patent/patentinfo.js

@@ -19,21 +19,21 @@ class PatentinfoService extends CrudService {
     this.personalModel = this.ctx.model.Personal;
     this.organizationModel = this.ctx.model.Organization;
 
-    // this.root_path = _.get(this.ctx.app.config.export, 'root_path');
-    // if (process.env.NODE_ENV === 'development') {
-    //   this.root_path = 'S:\\workspace\\exportFile\\';
-    // }
-    // this.file_type = '';
-    // if (!fs.existsSync(`${this.root_path}${this.file_type}`)) {
-    //   // 如果不存在文件夹,就创建
-    //   fs.mkdirSync(`${this.root_path}${this.file_type}`);
-    // }
-    // this.excel_path = `${sep}excel${sep}`;
-    // this.domain = 'http://127.0.0.1';
-    // if (process.env.NODE_ENV === 'development') {
-    //   this.domain = 'http://127.0.0.1:9999';
-    // }
-    // this.export_limit = 50;
+    this.root_path = _.get(this.ctx.app.config.export, 'root_path');
+    if (process.env.NODE_ENV === 'development') {
+      this.root_path = 'S:\\workspace\\exportFile\\';
+    }
+    this.file_type = '';
+    if (!fs.existsSync(`${this.root_path}${this.file_type}`)) {
+      // 如果不存在文件夹,就创建
+      fs.mkdirSync(`${this.root_path}${this.file_type}`);
+    }
+    this.excel_path = `${sep}excel${sep}`;
+    this.domain = 'http://127.0.0.1';
+    if (process.env.NODE_ENV === 'development') {
+      this.domain = 'http://127.0.0.1:9999';
+    }
+    this.export_limit = 50;
   }
 
   async query(query, { skip = 0, limit = 0 }) {