Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sb_h5
Project
Project
Details
Activity
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
data_server
sb_h5
Commits
fab7e5d5
Commit
fab7e5d5
authored
Apr 09, 2019
by
高诸锋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【del 定时任务】
parent
b1de9727
Pipeline
#5739
passed with stage
in 15 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
50 deletions
+0
-50
flash_cus_pro.js
app/schedule/flash_cus_pro.js
+0
-23
getNodeLimit.js
app/schedule/getNodeLimit.js
+0
-27
No files found.
app/schedule/flash_cus_pro.js
deleted
100644 → 0
View file @
b1de9727
'use strict'
;
module
.
exports
=
{
schedule
:
{
interval
:
'5m'
,
// 5分钟间隔
type
:
'all'
,
// 所有woker
immediate
:
true
,
},
async
task
(
ctx
)
{
try
{
const
dbRes
=
await
ctx
.
cusPro
.
query
(
'SELECT app_key FROM customer_product WHERE goods_sn = 108 AND state = 1'
,
{
type
:
'SELECT'
,
});
const
arr
=
[];
for
(
const
item
of
dbRes
)
{
arr
.
push
(
item
.
app_key
);
}
ctx
.
app
.
appKeyArr
=
arr
;
}
catch
(
e
)
{
ctx
.
logger
.
error
(
'【schedule/flash_cus_pro】catch error:'
,
e
);
}
},
};
app/schedule/getNodeLimit.js
deleted
100644 → 0
View file @
b1de9727
'use strict'
;
module
.
exports
=
app
=>
{
return
{
schedule
:
{
interval
:
'5m'
,
// 5分钟间隔
type
:
'all'
,
immediate
:
true
,
},
// 定时操作node_gjj.node_limit表
async
task
(
ctx
)
{
const
rows
=
await
ctx
.
nodeGjj
.
query
(
'SELECT appKey, currentCount, limitCount, text FROM node_limit WHERE type = shebao'
,
{
type
:
'SELECT'
});
const
map
=
new
Map
();
rows
.
forEach
(
item
=>
{
const
{
currentCount
,
limitCount
,
text
}
=
item
;
const
obj
=
{
currentCount
,
limitCount
,
env
:
text
,
};
map
.
set
(
item
.
appKey
,
obj
);
});
ctx
.
app
.
modeLimitMap
=
map
;
},
};
};
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