Commit 2ac07526 authored by 李尚科's avatar 李尚科

fix

parent 0084bf70
Pipeline #12314 passed with stage
in 31 seconds
......@@ -26,11 +26,9 @@ class HuaYunPaas extends Subscription {
ctx.logger.info(lock);
ctx.logger.info(JSON.stringify(await app.redis.get(lock)));
let redRes = await app.redis.setnx(lock, 1);
ctx.logger.info(JSON.stringify(redRes));
ctx.logger.info('in cron');
return;
await app.redis.expire(lock, 2);
if (Number(redRes) === 1) {
await app.redis.expire(lock, 2);
ctx.logger.info('in redis');
await this.logic();
}
......@@ -54,7 +52,7 @@ class HuaYunPaas extends Subscription {
ctx.logger.info(JSON.stringify({ start_time, now_time, start, limit }));
const result = await ctx.curl(url, { method: 'POST', contentType: 'json', dataType: 'json', timing: true, timeout: 300000, data: { start_time, end_time: now_time, start, limit } });
const ret = result.data;
ctx.logger.info(JSON.stringify({ ret }));
// ctx.logger.info(JSON.stringify({ ret }));
ctx.logger.info('get result');
if (ret.status != 0 || !ret.message || ret.count == 0) {
return;
......@@ -79,7 +77,7 @@ class HuaYunPaas extends Subscription {
if (!ret || ret.status === 1 || !ret.message) {
ctx.faild('get accessToken failed!');
}
ctx.logger.info(JSON.stringify({ ret }));
// ctx.logger.info(JSON.stringify({ ret }));
return ret.message;
}
......
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