@kne/fastify-task 0.1.9 → 0.1.10

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.
@@ -146,8 +146,8 @@ module.exports = fp(async (fastify, options) => {
146
146
  return task;
147
147
  };
148
148
 
149
- const cancel = async ({ id, targetId, targetType }) => {
150
- if (targetId && targetType) {
149
+ const cancel = async ({ id, targetId, targetType, type }) => {
150
+ if (targetId && targetType && type) {
151
151
  return await models.task.update(
152
152
  {
153
153
  status: 'canceled'
@@ -156,6 +156,7 @@ module.exports = fp(async (fastify, options) => {
156
156
  where: {
157
157
  targetId,
158
158
  targetType,
159
+ type,
159
160
  status: {
160
161
  [Op.in]: ['pending', 'running']
161
162
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kne/fastify-task",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "用于编排任务,追踪任务执行状态,结果",
5
5
  "main": "index.js",
6
6
  "scripts": {