Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qa-api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
QA
qa-api
Commits
9bd6e83b
Commit
9bd6e83b
authored
Aug 29, 2020
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化log
parent
123f6208
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
dbsync.js
app/controller/dbsync.js
+17
-1
k8s.js
app/controller/k8s.js
+4
-1
No files found.
app/controller/dbsync.js
View file @
9bd6e83b
...
...
@@ -47,7 +47,7 @@ const dbSync = async function (ctx) {
not_delete_business_data
:
req
.
not_delete_business_data
,
use_cache
:
req
.
use_cache
,
domain
,
})
})
ctx
.
body
=
ctx
.
ok
({
location
:
res
.
location
})
}
...
...
@@ -97,6 +97,22 @@ const dbSyncTke = async function (ctx) {
ctx
.
body
=
ctx
.
fail
(
'
获取mysql服务端口号失败
'
)
return
}
// 数据库同步时新增行为记录
if
(
ctx
.
request
.
method
===
'
POST
'
&&
ctx
.
response
.
status
===
200
)
{
const
user
=
await
ctx
.
redisGet
(
config
.
QA_TOKEN
,
ctx
.
request
.
header
[
'
x-token
'
])
if
(
user
)
{
const
body
=
ctx
.
request
.
body
const
data
=
{
namespace
:
body
.
namespace
,
active
:
'
同步
'
+
body
.
mysqlName
,
microservice_name
:
body
.
dbname
,
user
:
user
.
cn
,
user_mail
:
user
.
mail
,
detail
:
body
,
}
await
StatisticsLog
.
saveLog
(
data
);
}
}
res
=
await
jenkinsService
.
build_with_params
(
'
sync_database_schema
'
,
{
depth
:
1
,
...
...
app/controller/k8s.js
View file @
9bd6e83b
...
...
@@ -19,7 +19,10 @@ const api = async function (ctx) {
user_mail
:
user
.
mail
,
detail
:
body
,
}
await
StatisticsLog
.
saveLog
(
data
);
// 用户行为记录中过滤rabbitmq
if
(
!
(
data
.
active
===
'
service_details
'
&&
data
.
microservice_name
===
'
rabbitmq
'
))
{
await
StatisticsLog
.
saveLog
(
data
);
}
}
}
}
...
...
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