@kne/fastify-task 1.0.3 → 1.0.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.
@@ -302,8 +302,8 @@ module.exports = fp(async (fastify, options) => {
302
302
 
303
303
  const retryFunc = async ({ id }) => {
304
304
  const task = await detail({ id });
305
- if (task.status !== 'failed') {
306
- throw new Error('只有失败的任务允许重试');
305
+ if (['failed', 'canceled'].indexOf(task.status) === -1) {
306
+ throw new Error('只有失败或取消的任务允许重试');
307
307
  }
308
308
  await task.update({
309
309
  status: 'pending',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kne/fastify-task",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "用于编排任务,追踪任务执行状态,结果",
5
5
  "main": "index.js",
6
6
  "scripts": {