Commit c3f135a0 authored by 黎博's avatar 黎博

打印日志

parent 9bd6e83b
......@@ -97,9 +97,25 @@ const dbSyncTke = async function (ctx) {
ctx.body = ctx.fail('获取mysql服务端口号失败')
return
}
res = await jenkinsService.build_with_params('sync_database_schema', {
depth: 1,
sync_db_name: req.dbname,
target_db_host: publicIp,
target_db_port: port,
re_replace_ip: req.namespace,
not_delete_business_data: req.not_delete_business_data,
use_cache: req.use_cache,
domain: domainTKE,
})
ctx.body = ctx.ok({ location: res.location })
// 数据库同步时新增行为记录
if (ctx.request.method === 'POST' && ctx.response.status === 200 ) {
logger.info('已进入记录日志里')
logger.info('ctx.request:' + ctx.request)
const user = await ctx.redisGet(config.QA_TOKEN, ctx.request.header['x-token'])
logger.info('user:' + user)
if (user) {
const body = ctx.request.body
const data = {
......@@ -113,18 +129,6 @@ const dbSyncTke = async function (ctx) {
await StatisticsLog.saveLog(data);
}
}
res = await jenkinsService.build_with_params('sync_database_schema', {
depth: 1,
sync_db_name: req.dbname,
target_db_host: publicIp,
target_db_port: port,
re_replace_ip: req.namespace,
not_delete_business_data: req.not_delete_business_data,
use_cache: req.use_cache,
domain: domainTKE,
})
ctx.body = ctx.ok({ location: res.location })
}
const dbSyncQuery = async function (ctx) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment