@kne/fastify-task 0.1.3 → 0.1.4

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.
@@ -150,13 +150,12 @@ module.exports = fp(async (fastify, options) => {
150
150
  if (id) {
151
151
  const task = await detail({ id });
152
152
  if (!['pending', 'running'].includes(task.type)) {
153
- throw new Error('任务状态不允许取消');
153
+ return;
154
154
  }
155
155
  return await task.update({
156
156
  status: 'canceled'
157
157
  });
158
158
  }
159
- throw new Error('参数错误');
160
159
  };
161
160
 
162
161
  const complete = async ({ id, userId, output, ...props }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kne/fastify-task",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "用于编排任务,追踪任务执行状态,结果",
5
5
  "main": "index.js",
6
6
  "scripts": {