arcway 0.4.1 → 0.4.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arcway",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "A convention-based framework for building modular monoliths with strict domain boundaries.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -156,9 +156,18 @@ class JobRunner {
156
156
  }
157
157
  }
158
158
  for (const sj of systemJobs) {
159
- if (sj.schedule) {
159
+ const qualifiedName = `${sj.domainName}/${sj.jobName}`;
160
+ if (sj.schedule === 'continuous') {
161
+ const registered = this._dispatcher.registered.get(qualifiedName);
162
+ this._continuousJobs.push({
163
+ qualifiedName,
164
+ handler: registered.definition.handler,
165
+ cooldownMs: registered.definition.cooldownMs,
166
+ appContext: registered.store,
167
+ });
168
+ } else if (sj.schedule) {
160
169
  this._cronEntries.push({
161
- qualifiedName: `${sj.domainName}/${sj.jobName}`,
170
+ qualifiedName,
162
171
  fields: parseCron(sj.schedule),
163
172
  });
164
173
  }
@@ -90,6 +90,8 @@ function registerSendJob(driver, queue, throughput) {
90
90
  addSystemJobEntry({
91
91
  definition: {
92
92
  name: MAIL_JOB_NAME,
93
+ schedule: 'continuous',
94
+ cooldownMs: 1000,
93
95
  handler: async () => {
94
96
  if (!queue) return;
95
97
  const items = await queue.pop(MAIL_TOPIC, 10);