@chevre/domain 25.2.0-alpha.57 → 25.2.0-alpha.58

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.
@@ -46,6 +46,8 @@ export declare class ScheduledTaskRepo {
46
46
  name: string;
47
47
  };
48
48
  nameFilterBeforeRunsAt: boolean;
49
+ }, options: {
50
+ noEmitEvent: boolean;
49
51
  }): Promise<Pick<factory.task.ITask<factory.taskName>, 'id' | 'name'> | null>;
50
52
  deleteTooOldReadyTasks(params: {
51
53
  project: {
@@ -61,10 +61,13 @@ class ScheduledTaskRepo {
61
61
  /**
62
62
  * 実行日時を一定期間過ぎたReadyタスクについて、Runningスタータスに変更した上で、Runningイベントを発生させる
63
63
  */
64
- async emitRunningScheduledTaskIfExists(params) {
64
+ async emitRunningScheduledTaskIfExists(params, options
65
+ // next?: INextFunction // 現時点でタスク遅延実行ではnext指定なし(2026-07-30)
66
+ ) {
65
67
  if (!(params.runsAt.$lt instanceof Date)) {
66
68
  throw new factory_1.factory.errors.Argument('runsAt.$lt', 'must be Date');
67
69
  }
70
+ const { noEmitEvent } = options;
68
71
  const projection = {
69
72
  _id: 0,
70
73
  id: { $toString: '$_id' },
@@ -101,12 +104,14 @@ class ScheduledTaskRepo {
101
104
  if (doc === null) {
102
105
  return null;
103
106
  }
104
- const changedTask = {
105
- id: doc.id,
106
- status: factory_1.factory.taskStatus.Running,
107
- name: nameEq
108
- };
109
- task_1.taskEventEmitter.emitTaskStatusChanged(changedTask);
107
+ if (!noEmitEvent) {
108
+ const changedTask = {
109
+ id: doc.id,
110
+ status: factory_1.factory.taskStatus.Running,
111
+ name: nameEq
112
+ };
113
+ task_1.taskEventEmitter.emitTaskStatusChanged(changedTask);
114
+ }
110
115
  return doc;
111
116
  }
112
117
  async deleteTooOldReadyTasks(params) {
package/package.json CHANGED
@@ -88,5 +88,5 @@
88
88
  "postversion": "git push origin --tags",
89
89
  "prepublishOnly": "npm run clean && npm run build"
90
90
  },
91
- "version": "25.2.0-alpha.57"
91
+ "version": "25.2.0-alpha.58"
92
92
  }