@kne/fastify-task 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -84,7 +84,8 @@ module.exports = fp(async (fastify, options) => {
84
84
  }
85
85
  },
86
86
  async request => {
87
- return services.cancel(request.body);
87
+ await services.cancel(request.body);
88
+ return {};
88
89
  }
89
90
  );
90
91
 
@@ -105,7 +106,8 @@ module.exports = fp(async (fastify, options) => {
105
106
  }
106
107
  },
107
108
  async request => {
108
- return services.retry(request.body);
109
+ await services.retry(request.body);
110
+ return {};
109
111
  }
110
112
  );
111
113
  });
@@ -149,7 +149,7 @@ module.exports = fp(async (fastify, options) => {
149
149
  }
150
150
  if (id) {
151
151
  const task = await detail({ id });
152
- if (!['pending', 'running'].includes(task.type)) {
152
+ if (!['pending', 'running'].includes(task.status)) {
153
153
  return;
154
154
  }
155
155
  return await task.update({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kne/fastify-task",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "用于编排任务,追踪任务执行状态,结果",
5
5
  "main": "index.js",
6
6
  "scripts": {