Commit 818a47c0 authored by 何娜's avatar 何娜

新版调度器 创建任务增加入参

parent 6aa3f1f6
Pipeline #27251 passed with stage
in 22 seconds
...@@ -50,7 +50,7 @@ class TaskController extends Controller { ...@@ -50,7 +50,7 @@ class TaskController extends Controller {
ctx.validate(this.createRule); ctx.validate(this.createRule);
const { scriptId, orderId } = ctx.request.body; const { scriptId, orderId } = ctx.request.body;
await service.task.iplimit(); await service.task.iplimit();
const taskId = await service.task.create(scriptId); const taskId = await service.task.create({cityId: scriptId, orderId});
await service.order.update({ orderId, cityId: scriptId, taskId: String(taskId) }); await service.order.update({ orderId, cityId: scriptId, taskId: String(taskId) });
await service.cache.set({ await service.cache.set({
key: String(taskId), key: String(taskId),
......
...@@ -49,7 +49,11 @@ class TaskService extends Service { ...@@ -49,7 +49,11 @@ class TaskService extends Service {
const { createTaskUrl } = taskAPI; const { createTaskUrl } = taskAPI;
const result = await this._request(createTaskUrl, { const result = await this._request(createTaskUrl, {
method: 'post', method: 'post',
data: { cityId: data }, data: {
cityId: data.cityId,
orderId: data.orderId || '',
source: 'gjjH5new'
},
contentType: 'json', contentType: 'json',
}); });
ctx.logger.info(`【Task】create ${createTaskUrl} cityId: ${data} result:`, JSON.stringify(result.data)); ctx.logger.info(`【Task】create ${createTaskUrl} cityId: ${data} result:`, JSON.stringify(result.data));
......
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