Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
warden
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
姚广胤
warden
Commits
dc959f54
Commit
dc959f54
authored
Mar 26, 2018
by
姚广胤
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定时任务每个页面跑的次数
parent
55e08f54
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
index.js
server/task/index.js
+10
-4
No files found.
server/task/index.js
View file @
dc959f54
...
...
@@ -2,7 +2,7 @@
* @Author: ygy
* @Date: 2018-03-14 19:39:46
* @Last Modified by: ygy
* @Last Modified time: 2018-03-2
3 18:02:07
* @Last Modified time: 2018-03-2
6 09:46:19
*/
const
historyService
=
require
(
'../services/historyService'
);
...
...
@@ -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
=>
{
const
arr
=
page
[
'arr'
].
map
(
item
=>
item
[
'whiteTime'
]);
...
...
@@ -51,8 +59,6 @@ const runTiming = async () => {
});
};
// runTiming();
module
.
exports
=
{
runTiming
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment