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
55e08f54
Commit
55e08f54
authored
Mar 26, 2018
by
姚广胤
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定时任务错误修复
parent
1c72a2e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
app.js
server/app.js
+4
-6
No files found.
server/app.js
View file @
55e08f54
...
...
@@ -2,7 +2,7 @@
* @Author: ygy
* @Date: 2018-03-14 19:40:01
* @Last Modified by: ygy
* @Last Modified time: 2018-03-2
3 18:32:48
* @Last Modified time: 2018-03-2
6 09:43:45
*/
const
Koa
=
require
(
'koa'
);
const
send
=
require
(
'koa-send'
);
...
...
@@ -15,6 +15,7 @@ const templating = require('./utils/templating');
const
rest
=
require
(
'./utils/rest'
);
const
filter
=
require
(
'./filter/index'
);
const
task
=
require
(
'./task/index'
);
const
schedule
=
require
(
'node-schedule'
);
const
app
=
new
Koa
();
...
...
@@ -60,12 +61,9 @@ app.use(rest.restify());
// add controllers:
app
.
use
(
router
());
const
schedule
=
require
(
'node-schedule'
);
const
j
=
schedule
.
scheduleJob
({
hour
:
4
},
function
()
{
console
.
log
(
'执行任务开始'
);
// start task schedule
schedule
.
scheduleJob
({
hour
:
4
,
minute
:
0
,
second
:
0
},
()
=>
{
task
.
runTiming
();
console
.
log
(
'执行任务结束'
);
});
app
.
listen
(
5000
);
...
...
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