Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-arena-api
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
ygopro-arena-api
Commits
f1090e06
Commit
f1090e06
authored
Dec 31, 2019
by
Joe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update rule
parent
8940141e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
routes/api.js
routes/api.js
+24
-4
No files found.
routes/api.js
View file @
f1090e06
...
...
@@ -97,7 +97,7 @@ pool.on('error', function (err, client) {
*/
var
schedule
=
require
(
'
node-schedule
'
);
// 每月的1日0点30分30秒触发 :'30 30 0 1 * *'
var
j
=
schedule
.
scheduleJob
(
'
30 3
0 0 1 * *
'
,
function
()
{
var
j
=
schedule
.
scheduleJob
(
'
0
0 0 1 * *
'
,
function
()
{
console
.
log
(
'
The scheduleJob run on first day of every month!
'
,
moment
().
format
(
'
YYYY-MM-DD HH:mm
'
));
...
...
@@ -133,11 +133,23 @@ var j = schedule.scheduleJob('30 30 0 1 * *', function () {
// });
});
// cron job
/**
* * * * * *
┬ ┬ ┬ ┬ ┬ ┬
│ │ │ │ │ |
│ │ │ │ │ └ day of week (0 - 7) (0 or 7 is Sun)
│ │ │ │ └───── month (1 - 12)
│ │ │ └────────── day of month (1 - 31)
│ │ └─────────────── hour (0 - 23)
│ └──────────────────── minute (0 - 59)
└───────────────────────── second (0 - 59, OPTIONAL)
*/
schedule
.
scheduleJob
(
'
1 1 0 1 1 *
'
,
function
()
{
schedule
.
scheduleJob
(
'
0 0 0 1 7 *
'
,
function
()
{
console
.
log
(
'
The scheduleJob run on 1 Jan !
'
,
moment
().
format
(
'
YYYY-MM-DD HH:mm
'
));
console
.
log
(
'
The scheduleJob run on 1 July !
'
,
moment
().
format
(
'
YYYY-MM-DD HH:mm
'
));
pool
.
connect
(
function
(
err
,
client
,
done
)
{
if
(
err
)
{
return
console
.
error
(
'
error fetching client from pool
'
,
err
);
...
...
@@ -335,6 +347,14 @@ router.post('/score', function (req, res) {
}
}
// 处理-9的情况
if
(
userscoreA
===
-
9
)
{
ptResult
.
ptA
=
userA
.
pt
-
2
;
}
if
(
userscoreB
===
-
9
)
{
ptResult
.
ptB
=
userB
.
pt
-
2
;
}
// 2018.4.23 0秒的决斗,双方都不扣分 -- 星光
// var sametime = start == end
// if (sametime) {
...
...
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