Commit dc959f54 authored by 姚广胤's avatar 姚广胤

定时任务每个页面跑的次数

parent 55e08f54
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: ygy * @Author: ygy
* @Date: 2018-03-14 19:39:46 * @Date: 2018-03-14 19:39:46
* @Last Modified by: ygy * @Last Modified by: ygy
* @Last Modified time: 2018-03-23 18:02:07 * @Last Modified time: 2018-03-26 09:46:19
*/ */
const historyService = require('../services/historyService'); const historyService = require('../services/historyService');
...@@ -31,7 +31,15 @@ const runTiming = async () => { ...@@ -31,7 +31,15 @@ const runTiming = async () => {
} }
]; ];
const taskResults = await timing.iterateTimes(task, 2); let iterateTime;
if (process.env.NODE_ENV === 'production') {
iterateTime = 50;
} else {
iterateTime = 2;
}
const taskResults = await timing.iterateTimes(task, iterateTime);
taskResults.map(async page => { taskResults.map(async page => {
const arr = page['arr'].map(item => item['whiteTime']); const arr = page['arr'].map(item => item['whiteTime']);
...@@ -51,8 +59,6 @@ const runTiming = async () => { ...@@ -51,8 +59,6 @@ const runTiming = async () => {
}); });
}; };
// runTiming();
module.exports = { module.exports = {
runTiming runTiming
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment