@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.
- package/libs/services/main.js +2 -2
- package/package.json +1 -1
package/libs/services/main.js
CHANGED
|
@@ -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
|
|
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',
|