Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yysh5
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
yysh5
Commits
ed3d5d7e
Commit
ed3d5d7e
authored
Sep 09, 2020
by
何娜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加日志
parent
22bf6962
Pipeline
#28034
passed with stage
in 2 seconds
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
36 deletions
+3
-36
task.js
app/controller/task.js
+2
-0
notifyUrl.js
app/schedule/notifyUrl.js
+0
-34
schedules.js
app/service/schedules.js
+1
-0
task.js
app/service/task.js
+0
-2
No files found.
app/controller/task.js
View file @
ed3d5d7e
...
...
@@ -115,6 +115,7 @@ class TaskController extends Controller {
}
else
if
(
status
===
'success'
)
{
ws
.
send
(
JSON
.
stringify
({
errcode
:
0
,
data
:
{
state
:
2
,
result
:
'success'
}
}));
}
else
{
ctx
.
logger
.
info
(
'【wslink】 fetchTask'
)
const
result
=
await
service
.
task
.
fetchTask
({
taskId
});
let
data
,
wsMsg
;
...
...
@@ -223,6 +224,7 @@ class TaskController extends Controller {
ctx
.
body
=
{
code
:
200
,
};
ctx
.
logger
.
info
(
'【handleCallback】 fetchTask'
)
const
result
=
await
service
.
task
.
fetchTask
({
taskId
});
// let taskNote = {
// status: 'init',
...
...
app/schedule/notifyUrl.js
deleted
100644 → 0
View file @
22bf6962
'use strict'
;
module
.
exports
=
{
schedule
:
{
interval
:
'5m'
,
// 5分钟间隔
type
:
'all'
,
// 所有woker
immediate
:
true
,
},
async
task
(
ctx
)
{
try
{
const
{
host
,
customerUrl
}
=
ctx
.
app
.
config
.
signatureAPI
;
const
notifyMap
=
new
Map
();
const
ret
=
await
ctx
.
curl
(
host
+
customerUrl
,
{
charset
:
'utf-8'
,
timeout
:
[
30000
,
30000
],
dataType
:
'json'
,
contentType
:
'json'
,
});
// ctx.logger.info(JSON.stringify(ret.data));
if
(
ret
.
data
.
code
===
0
)
{
ret
.
data
.
data
.
customerList
.
map
(
customer
=>
{
if
(
'callBackUrl'
in
customer
)
{
notifyMap
.
set
(
customer
.
appKey
,
{
notifyUrl
:
customer
.
callBackUrl
});
}
});
}
ctx
.
app
.
notifyMap
=
notifyMap
;
// console.log(await ctx.helper.sendMsg({ message: 'test' }));
}
catch
(
e
)
{
ctx
.
logger
.
error
(
'【schedule/notifyUrlTask】catch error:'
,
JSON
.
stringify
(
e
));
}
},
};
app/service/schedules.js
View file @
ed3d5d7e
...
...
@@ -10,6 +10,7 @@ class ScheduleService extends Service {
attributes
:
[
'appKey'
,
'text2'
,
'currentCount'
,
'limitCount'
,
'customerUrl'
],
where
:
{
type
:
'thxd'
},
});
ctx
.
logger
.
info
(
'【Schedule】appKeylists'
,
ret
.
length
)
if
(
ret
.
length
>
0
)
{
ret
.
map
(
customer
=>
{
appKeylists
.
set
(
customer
.
appKey
,
{
...
...
app/service/task.js
View file @
ed3d5d7e
...
...
@@ -146,7 +146,6 @@ class TaskService extends Service {
}
phoneInfo
.
province
=
html
.
match
(
/province:'
(
.*
?)
'/
)[
1
];
phoneInfo
.
operator
=
html
.
match
(
/catName:'
(
.*
?)
'/
)[
1
];
ctx
.
logger
.
info
(
'phoneArea'
,
alhost
+
phone
,
JSON
.
stringify
(
phoneInfo
),
html
,
phone
);
if
(
phoneInfo
.
province
===
'香港'
)
{
phoneInfo
.
province
=
'广东'
;
}
...
...
@@ -155,7 +154,6 @@ class TaskService extends Service {
}
else
{
phoneInfo
.
operator
=
'虚拟运营商'
;
}
ctx
.
logger
.
info
(
'phoneArea result'
,
JSON
.
stringify
(
phoneInfo
),
phone
);
return
phoneInfo
;
}
...
...
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