@sidequest/engine 1.13.3 → 1.13.5
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/dist/dependency-registry.cjs +56 -0
- package/dist/dependency-registry.cjs.map +1 -0
- package/dist/dependency-registry.js +54 -0
- package/dist/dependency-registry.js.map +1 -0
- package/dist/engine.cjs +38 -44
- package/dist/engine.cjs.map +1 -1
- package/dist/engine.d.ts +3 -13
- package/dist/engine.js +38 -44
- package/dist/engine.js.map +1 -1
- package/dist/routines/release-stale-jobs.cjs +20 -2
- package/dist/routines/release-stale-jobs.cjs.map +1 -1
- package/dist/routines/release-stale-jobs.js +21 -3
- package/dist/routines/release-stale-jobs.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Enumeration of available dependency tokens for the dependency registry.
|
|
5
|
+
* Used as keys to register and retrieve dependencies throughout the engine.
|
|
6
|
+
*/
|
|
7
|
+
exports.Dependency = void 0;
|
|
8
|
+
(function (Dependency) {
|
|
9
|
+
/** Engine configuration */
|
|
10
|
+
Dependency["Config"] = "config";
|
|
11
|
+
/** Backend instance */
|
|
12
|
+
Dependency["Backend"] = "backend";
|
|
13
|
+
})(exports.Dependency || (exports.Dependency = {}));
|
|
14
|
+
/**
|
|
15
|
+
* A type-safe dependency injection container for managing core engine dependencies.
|
|
16
|
+
* Provides methods to register, retrieve, and clear dependencies used throughout the engine lifecycle.
|
|
17
|
+
*/
|
|
18
|
+
class DependencyRegistry {
|
|
19
|
+
/**
|
|
20
|
+
* Internal storage for registered dependencies.
|
|
21
|
+
*/
|
|
22
|
+
registry = new Map();
|
|
23
|
+
/**
|
|
24
|
+
* Retrieves a registered dependency by its token.
|
|
25
|
+
* @param token - The dependency token to look up
|
|
26
|
+
* @returns The registered dependency instance, or undefined if not found
|
|
27
|
+
*/
|
|
28
|
+
get(token) {
|
|
29
|
+
return this.registry.get(token);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Registers a dependency instance with the specified token.
|
|
33
|
+
* @param token - The dependency token to register under
|
|
34
|
+
* @param instance - The dependency instance to register
|
|
35
|
+
* @returns The registered instance
|
|
36
|
+
*/
|
|
37
|
+
register(token, instance) {
|
|
38
|
+
this.registry.set(token, instance);
|
|
39
|
+
return instance;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Clears all registered dependencies from the registry.
|
|
43
|
+
* Useful for cleanup and testing scenarios.
|
|
44
|
+
*/
|
|
45
|
+
clear() {
|
|
46
|
+
this.registry.clear();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Singleton instance of the dependency registry.
|
|
51
|
+
* This is the main container used throughout the engine to manage dependencies.
|
|
52
|
+
*/
|
|
53
|
+
const dependencyRegistry = new DependencyRegistry();
|
|
54
|
+
|
|
55
|
+
exports.dependencyRegistry = dependencyRegistry;
|
|
56
|
+
//# sourceMappingURL=dependency-registry.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependency-registry.cjs","sources":["../src/dependency-registry.ts"],"sourcesContent":[null],"names":["Dependency"],"mappings":";;AAGA;;;AAGG;AACSA;AAAZ,CAAA,UAAY,UAAU,EAAA;;AAEpB,IAAA,UAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;;AAEjB,IAAA,UAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACrB,CAAC,EALWA,kBAAU,KAAVA,kBAAU,GAAA,EAAA,CAAA,CAAA;AAgBtB;;;AAGG;AACH,MAAM,kBAAkB,CAAA;AACtB;;AAEG;AACK,IAAA,QAAQ,GAAG,IAAI,GAAG,EAAuB;AAEjD;;;;AAIG;AACH,IAAA,GAAG,CAAuB,KAAQ,EAAA;QAChC,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAA2C;IAC3E;AAEA;;;;;AAKG;IACH,QAAQ,CAAuB,KAAQ,EAAE,QAAoC,EAAA;QAC3E,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC;AAClC,QAAA,OAAO,QAAQ;IACjB;AAEA;;;AAGG;IACH,KAAK,GAAA;AACH,QAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE;IACvB;AACD;AAED;;;AAGG;AACI,MAAM,kBAAkB,GAAG,IAAI,kBAAkB;;;;"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enumeration of available dependency tokens for the dependency registry.
|
|
3
|
+
* Used as keys to register and retrieve dependencies throughout the engine.
|
|
4
|
+
*/
|
|
5
|
+
var Dependency;
|
|
6
|
+
(function (Dependency) {
|
|
7
|
+
/** Engine configuration */
|
|
8
|
+
Dependency["Config"] = "config";
|
|
9
|
+
/** Backend instance */
|
|
10
|
+
Dependency["Backend"] = "backend";
|
|
11
|
+
})(Dependency || (Dependency = {}));
|
|
12
|
+
/**
|
|
13
|
+
* A type-safe dependency injection container for managing core engine dependencies.
|
|
14
|
+
* Provides methods to register, retrieve, and clear dependencies used throughout the engine lifecycle.
|
|
15
|
+
*/
|
|
16
|
+
class DependencyRegistry {
|
|
17
|
+
/**
|
|
18
|
+
* Internal storage for registered dependencies.
|
|
19
|
+
*/
|
|
20
|
+
registry = new Map();
|
|
21
|
+
/**
|
|
22
|
+
* Retrieves a registered dependency by its token.
|
|
23
|
+
* @param token - The dependency token to look up
|
|
24
|
+
* @returns The registered dependency instance, or undefined if not found
|
|
25
|
+
*/
|
|
26
|
+
get(token) {
|
|
27
|
+
return this.registry.get(token);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Registers a dependency instance with the specified token.
|
|
31
|
+
* @param token - The dependency token to register under
|
|
32
|
+
* @param instance - The dependency instance to register
|
|
33
|
+
* @returns The registered instance
|
|
34
|
+
*/
|
|
35
|
+
register(token, instance) {
|
|
36
|
+
this.registry.set(token, instance);
|
|
37
|
+
return instance;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Clears all registered dependencies from the registry.
|
|
41
|
+
* Useful for cleanup and testing scenarios.
|
|
42
|
+
*/
|
|
43
|
+
clear() {
|
|
44
|
+
this.registry.clear();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Singleton instance of the dependency registry.
|
|
49
|
+
* This is the main container used throughout the engine to manage dependencies.
|
|
50
|
+
*/
|
|
51
|
+
const dependencyRegistry = new DependencyRegistry();
|
|
52
|
+
|
|
53
|
+
export { Dependency, dependencyRegistry };
|
|
54
|
+
//# sourceMappingURL=dependency-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependency-registry.js","sources":["../src/dependency-registry.ts"],"sourcesContent":[null],"names":[],"mappings":"AAGA;;;AAGG;IACS;AAAZ,CAAA,UAAY,UAAU,EAAA;;AAEpB,IAAA,UAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;;AAEjB,IAAA,UAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACrB,CAAC,EALW,UAAU,KAAV,UAAU,GAAA,EAAA,CAAA,CAAA;AAgBtB;;;AAGG;AACH,MAAM,kBAAkB,CAAA;AACtB;;AAEG;AACK,IAAA,QAAQ,GAAG,IAAI,GAAG,EAAuB;AAEjD;;;;AAIG;AACH,IAAA,GAAG,CAAuB,KAAQ,EAAA;QAChC,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAA2C;IAC3E;AAEA;;;;;AAKG;IACH,QAAQ,CAAuB,KAAQ,EAAE,QAAoC,EAAA;QAC3E,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC;AAClC,QAAA,OAAO,QAAQ;IACjB;AAEA;;;AAGG;IACH,KAAK,GAAA;AACH,QAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE;IACvB;AACD;AAED;;;AAGG;AACI,MAAM,kBAAkB,GAAG,IAAI,kBAAkB;;;;"}
|
package/dist/engine.cjs
CHANGED
|
@@ -8,6 +8,7 @@ var os = require('os');
|
|
|
8
8
|
var url = require('url');
|
|
9
9
|
var util = require('util');
|
|
10
10
|
var constants$1 = require('./constants.cjs');
|
|
11
|
+
var dependencyRegistry = require('./dependency-registry.cjs');
|
|
11
12
|
var constants = require('./job/constants.cjs');
|
|
12
13
|
var cronRegistry = require('./job/cron-registry.cjs');
|
|
13
14
|
var jobBuilder = require('./job/job-builder.cjs');
|
|
@@ -22,17 +23,6 @@ require('piscina');
|
|
|
22
23
|
* The main engine for managing job queues and workers in Sidequest.
|
|
23
24
|
*/
|
|
24
25
|
class Engine {
|
|
25
|
-
/**
|
|
26
|
-
* Backend instance used by the engine.
|
|
27
|
-
* This is initialized when the engine is configured or started.
|
|
28
|
-
*/
|
|
29
|
-
backend;
|
|
30
|
-
/**
|
|
31
|
-
* Current configuration of the engine.
|
|
32
|
-
* This is set when the engine is configured or started.
|
|
33
|
-
* It contains all the necessary settings for the engine to operate, such as backend, queues, logger options, and job defaults.
|
|
34
|
-
*/
|
|
35
|
-
config;
|
|
36
26
|
/**
|
|
37
27
|
* Main worker process that runs the Sidequest engine.
|
|
38
28
|
* This is created when the engine is started and handles job processing.
|
|
@@ -49,11 +39,11 @@ class Engine {
|
|
|
49
39
|
* @returns The resolved configuration.
|
|
50
40
|
*/
|
|
51
41
|
async configure(config) {
|
|
52
|
-
if (this.
|
|
42
|
+
if (this.getConfig()) {
|
|
53
43
|
core.logger("Engine").debug("Sidequest already configured");
|
|
54
|
-
return this.
|
|
44
|
+
return this.getConfig();
|
|
55
45
|
}
|
|
56
|
-
|
|
46
|
+
const nonNullConfig = {
|
|
57
47
|
queues: config?.queues ?? [],
|
|
58
48
|
backend: {
|
|
59
49
|
driver: config?.backend?.driver ?? "@sidequest/sqlite-backend",
|
|
@@ -92,16 +82,17 @@ class Engine {
|
|
|
92
82
|
jobsFilePath: config?.jobsFilePath?.trim() ?? "",
|
|
93
83
|
jobPollingInterval: config?.jobPollingInterval ?? 100,
|
|
94
84
|
};
|
|
85
|
+
dependencyRegistry.dependencyRegistry.register(dependencyRegistry.Dependency.Config, nonNullConfig);
|
|
95
86
|
this.validateConfig();
|
|
96
|
-
core.logger("Engine").debug(`Configuring Sidequest engine: ${util.inspect(
|
|
97
|
-
if (
|
|
98
|
-
core.configureLogger(
|
|
87
|
+
core.logger("Engine").debug(`Configuring Sidequest engine: ${util.inspect(nonNullConfig)}`);
|
|
88
|
+
if (nonNullConfig.logger) {
|
|
89
|
+
core.configureLogger(nonNullConfig.logger);
|
|
99
90
|
}
|
|
100
|
-
|
|
101
|
-
if (!
|
|
102
|
-
await
|
|
91
|
+
const backend$1 = dependencyRegistry.dependencyRegistry.register(dependencyRegistry.Dependency.Backend, new backend.LazyBackend(nonNullConfig.backend));
|
|
92
|
+
if (!nonNullConfig.skipMigration) {
|
|
93
|
+
await backend$1.migrate();
|
|
103
94
|
}
|
|
104
|
-
return
|
|
95
|
+
return nonNullConfig;
|
|
105
96
|
}
|
|
106
97
|
/**
|
|
107
98
|
* Validates the engine configuration settings.
|
|
@@ -120,17 +111,18 @@ class Engine {
|
|
|
120
111
|
* - Logs the resolved jobs file path when using manual job resolution
|
|
121
112
|
*/
|
|
122
113
|
validateConfig() {
|
|
123
|
-
|
|
114
|
+
const config = this.getConfig();
|
|
115
|
+
if (config.maxConcurrentJobs !== undefined && config.maxConcurrentJobs < 1) {
|
|
124
116
|
throw new Error(`Invalid "maxConcurrentJobs" value: must be at least 1.`);
|
|
125
117
|
}
|
|
126
|
-
if (
|
|
127
|
-
if (
|
|
128
|
-
const scriptUrl = manualLoader.resolveScriptPath(
|
|
118
|
+
if (config.manualJobResolution) {
|
|
119
|
+
if (config.jobsFilePath) {
|
|
120
|
+
const scriptUrl = manualLoader.resolveScriptPath(config.jobsFilePath);
|
|
129
121
|
if (!fs.existsSync(url.fileURLToPath(scriptUrl))) {
|
|
130
122
|
throw new Error(`The specified jobsFilePath does not exist. Resolved to: ${scriptUrl}`);
|
|
131
123
|
}
|
|
132
|
-
core.logger("Engine").info(`Using manual jobs file at: ${
|
|
133
|
-
|
|
124
|
+
core.logger("Engine").info(`Using manual jobs file at: ${config.jobsFilePath}`);
|
|
125
|
+
config.jobsFilePath = scriptUrl;
|
|
134
126
|
}
|
|
135
127
|
else {
|
|
136
128
|
// This should throw an error if not found
|
|
@@ -147,11 +139,11 @@ class Engine {
|
|
|
147
139
|
core.logger("Engine").warn("Sidequest engine already started");
|
|
148
140
|
return;
|
|
149
141
|
}
|
|
150
|
-
await this.configure(config);
|
|
151
|
-
core.logger("Engine").info(`Starting Sidequest using backend ${
|
|
152
|
-
if (
|
|
153
|
-
for (const queue of
|
|
154
|
-
await grantQueueConfig.grantQueueConfig(
|
|
142
|
+
const nonNullConfig = await this.configure(config);
|
|
143
|
+
core.logger("Engine").info(`Starting Sidequest using backend ${nonNullConfig.backend.driver}`);
|
|
144
|
+
if (nonNullConfig.queues) {
|
|
145
|
+
for (const queue of nonNullConfig.queues) {
|
|
146
|
+
await grantQueueConfig.grantQueueConfig(dependencyRegistry.dependencyRegistry.get(dependencyRegistry.Dependency.Backend), queue, nonNullConfig.queueDefaults, true);
|
|
155
147
|
}
|
|
156
148
|
}
|
|
157
149
|
return new Promise((resolve, reject) => {
|
|
@@ -166,7 +158,7 @@ class Engine {
|
|
|
166
158
|
this.mainWorker.on("message", (msg) => {
|
|
167
159
|
if (msg === "ready") {
|
|
168
160
|
core.logger("Engine").debug("Main worker is ready");
|
|
169
|
-
this.mainWorker?.send({ type: "start", sidequestConfig:
|
|
161
|
+
this.mainWorker?.send({ type: "start", sidequestConfig: nonNullConfig });
|
|
170
162
|
clearTimeout(timeout);
|
|
171
163
|
resolve();
|
|
172
164
|
}
|
|
@@ -179,7 +171,7 @@ class Engine {
|
|
|
179
171
|
});
|
|
180
172
|
};
|
|
181
173
|
runWorker();
|
|
182
|
-
shutdown.gracefulShutdown(this.close.bind(this), "Engine",
|
|
174
|
+
shutdown.gracefulShutdown(this.close.bind(this), "Engine", nonNullConfig.gracefulShutdown);
|
|
183
175
|
}
|
|
184
176
|
});
|
|
185
177
|
}
|
|
@@ -188,14 +180,14 @@ class Engine {
|
|
|
188
180
|
* @returns The current configuration, if set.
|
|
189
181
|
*/
|
|
190
182
|
getConfig() {
|
|
191
|
-
return
|
|
183
|
+
return dependencyRegistry.dependencyRegistry.get(dependencyRegistry.Dependency.Config);
|
|
192
184
|
}
|
|
193
185
|
/**
|
|
194
186
|
* Gets the backend instance in use by the engine.
|
|
195
187
|
* @returns The backend instance, if set.
|
|
196
188
|
*/
|
|
197
189
|
getBackend() {
|
|
198
|
-
return
|
|
190
|
+
return dependencyRegistry.dependencyRegistry.get(dependencyRegistry.Dependency.Backend);
|
|
199
191
|
}
|
|
200
192
|
/**
|
|
201
193
|
* Closes the engine and releases resources.
|
|
@@ -214,19 +206,19 @@ class Engine {
|
|
|
214
206
|
await promise;
|
|
215
207
|
}
|
|
216
208
|
try {
|
|
217
|
-
await
|
|
209
|
+
await dependencyRegistry.dependencyRegistry.get(dependencyRegistry.Dependency.Backend)?.close();
|
|
218
210
|
}
|
|
219
211
|
catch (error) {
|
|
220
212
|
core.logger("Engine").error("Error closing backend:", error);
|
|
221
213
|
}
|
|
222
|
-
this.config = undefined;
|
|
223
|
-
this.backend = undefined;
|
|
224
214
|
this.mainWorker = undefined;
|
|
225
215
|
// Reset the shutting down flag after closing
|
|
226
216
|
// This allows the engine to be reconfigured or restarted later
|
|
227
217
|
shutdown.clearGracefulShutdown();
|
|
228
218
|
core.logger("Engine").debug("Sidequest engine closed.");
|
|
229
219
|
this.shuttingDown = false;
|
|
220
|
+
// Clear the dependency registry to allow fresh configuration later
|
|
221
|
+
dependencyRegistry.dependencyRegistry.clear();
|
|
230
222
|
}
|
|
231
223
|
}
|
|
232
224
|
/**
|
|
@@ -235,19 +227,21 @@ class Engine {
|
|
|
235
227
|
* @returns A new JobBuilder instance for the job class.
|
|
236
228
|
*/
|
|
237
229
|
build(JobClass) {
|
|
238
|
-
|
|
230
|
+
const backend = this.getBackend();
|
|
231
|
+
const config = this.getConfig();
|
|
232
|
+
if (!config || !backend) {
|
|
239
233
|
throw new Error("Engine not configured. Call engine.configure() or engine.start() first.");
|
|
240
234
|
}
|
|
241
235
|
if (this.shuttingDown) {
|
|
242
236
|
throw new Error("Engine is shutting down, cannot build job.");
|
|
243
237
|
}
|
|
244
238
|
core.logger("Engine").debug(`Building job for class: ${JobClass.name}`);
|
|
245
|
-
return new jobBuilder.JobBuilder(
|
|
246
|
-
...
|
|
239
|
+
return new jobBuilder.JobBuilder(backend, JobClass, {
|
|
240
|
+
...config.jobDefaults,
|
|
247
241
|
// We need to do this check again because available at is a getter. It needs to be set at job creation time.
|
|
248
242
|
// If not set, it will use the fallback value which is outdated from config.
|
|
249
|
-
availableAt:
|
|
250
|
-
},
|
|
243
|
+
availableAt: config.jobDefaults.availableAt ?? constants.JOB_BUILDER_FALLBACK.availableAt,
|
|
244
|
+
}, config.manualJobResolution);
|
|
251
245
|
}
|
|
252
246
|
}
|
|
253
247
|
|
package/dist/engine.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.cjs","sources":["../src/engine.ts"],"sourcesContent":[null],"names":["logger","cpus","MISC_FALLBACK","JOB_BUILDER_FALLBACK","QUEUE_FALLBACK","inspect","configureLogger","LazyBackend","resolveScriptPath","existsSync","fileURLToPath","findSidequestJobsScriptInParentDirs","grantQueueConfig","fork","DEFAULT_WORKER_PATH","gracefulShutdown","ScheduledJobRegistry","clearGracefulShutdown","JobBuilder"],"mappings":"
|
|
1
|
+
{"version":3,"file":"engine.cjs","sources":["../src/engine.ts"],"sourcesContent":[null],"names":["logger","cpus","MISC_FALLBACK","JOB_BUILDER_FALLBACK","QUEUE_FALLBACK","dependencyRegistry","Dependency","inspect","configureLogger","backend","LazyBackend","resolveScriptPath","existsSync","fileURLToPath","findS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D;AACA,QAAAL,WAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAA,wBAAA,EAA2B,QAAQ,CAAC,IAAI,CAAA,CAAE,CAAC;AAClE,QAAA,OAAO,IAAIqB,qBAAU,CACnB,OAAO,EACP,QAAQ,EACR;YACE,GAAG,MAAM,CAAC,WAAW;;;YAGrB,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,WAAW,IAAIlB,8BAAoB,CAAC,WAAY;AACjF,SAAA,EACD,MAAM,CAAC,mBAAmB,CAC3B;IACH;AACD;;;;"}
|
package/dist/engine.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _sidequest_backend from '@sidequest/backend';
|
|
2
|
+
import { BackendConfig, NewQueueData } from '@sidequest/backend';
|
|
2
3
|
import { LoggerOptions, JobClassType } from '@sidequest/core';
|
|
3
4
|
import { JobBuilderDefaults, JobBuilder } from './job/job-builder.js';
|
|
4
5
|
import { QueueDefaults } from './queue/grant-queue-config.js';
|
|
@@ -104,17 +105,6 @@ type NonNullableEngineConfig = {
|
|
|
104
105
|
* The main engine for managing job queues and workers in Sidequest.
|
|
105
106
|
*/
|
|
106
107
|
declare class Engine {
|
|
107
|
-
/**
|
|
108
|
-
* Backend instance used by the engine.
|
|
109
|
-
* This is initialized when the engine is configured or started.
|
|
110
|
-
*/
|
|
111
|
-
private backend?;
|
|
112
|
-
/**
|
|
113
|
-
* Current configuration of the engine.
|
|
114
|
-
* This is set when the engine is configured or started.
|
|
115
|
-
* It contains all the necessary settings for the engine to operate, such as backend, queues, logger options, and job defaults.
|
|
116
|
-
*/
|
|
117
|
-
private config?;
|
|
118
108
|
/**
|
|
119
109
|
* Main worker process that runs the Sidequest engine.
|
|
120
110
|
* This is created when the engine is started and handles job processing.
|
|
@@ -162,7 +152,7 @@ declare class Engine {
|
|
|
162
152
|
* Gets the backend instance in use by the engine.
|
|
163
153
|
* @returns The backend instance, if set.
|
|
164
154
|
*/
|
|
165
|
-
getBackend(): Backend | undefined;
|
|
155
|
+
getBackend(): _sidequest_backend.Backend | undefined;
|
|
166
156
|
/**
|
|
167
157
|
* Closes the engine and releases resources.
|
|
168
158
|
*/
|
package/dist/engine.js
CHANGED
|
@@ -6,6 +6,7 @@ import { cpus } from 'os';
|
|
|
6
6
|
import { fileURLToPath } from 'url';
|
|
7
7
|
import { inspect } from 'util';
|
|
8
8
|
import { DEFAULT_WORKER_PATH } from './constants.js';
|
|
9
|
+
import { dependencyRegistry, Dependency } from './dependency-registry.js';
|
|
9
10
|
import { JOB_BUILDER_FALLBACK } from './job/constants.js';
|
|
10
11
|
import { ScheduledJobRegistry } from './job/cron-registry.js';
|
|
11
12
|
import { JobBuilder } from './job/job-builder.js';
|
|
@@ -20,17 +21,6 @@ import 'piscina';
|
|
|
20
21
|
* The main engine for managing job queues and workers in Sidequest.
|
|
21
22
|
*/
|
|
22
23
|
class Engine {
|
|
23
|
-
/**
|
|
24
|
-
* Backend instance used by the engine.
|
|
25
|
-
* This is initialized when the engine is configured or started.
|
|
26
|
-
*/
|
|
27
|
-
backend;
|
|
28
|
-
/**
|
|
29
|
-
* Current configuration of the engine.
|
|
30
|
-
* This is set when the engine is configured or started.
|
|
31
|
-
* It contains all the necessary settings for the engine to operate, such as backend, queues, logger options, and job defaults.
|
|
32
|
-
*/
|
|
33
|
-
config;
|
|
34
24
|
/**
|
|
35
25
|
* Main worker process that runs the Sidequest engine.
|
|
36
26
|
* This is created when the engine is started and handles job processing.
|
|
@@ -47,11 +37,11 @@ class Engine {
|
|
|
47
37
|
* @returns The resolved configuration.
|
|
48
38
|
*/
|
|
49
39
|
async configure(config) {
|
|
50
|
-
if (this.
|
|
40
|
+
if (this.getConfig()) {
|
|
51
41
|
logger("Engine").debug("Sidequest already configured");
|
|
52
|
-
return this.
|
|
42
|
+
return this.getConfig();
|
|
53
43
|
}
|
|
54
|
-
|
|
44
|
+
const nonNullConfig = {
|
|
55
45
|
queues: config?.queues ?? [],
|
|
56
46
|
backend: {
|
|
57
47
|
driver: config?.backend?.driver ?? "@sidequest/sqlite-backend",
|
|
@@ -90,16 +80,17 @@ class Engine {
|
|
|
90
80
|
jobsFilePath: config?.jobsFilePath?.trim() ?? "",
|
|
91
81
|
jobPollingInterval: config?.jobPollingInterval ?? 100,
|
|
92
82
|
};
|
|
83
|
+
dependencyRegistry.register(Dependency.Config, nonNullConfig);
|
|
93
84
|
this.validateConfig();
|
|
94
|
-
logger("Engine").debug(`Configuring Sidequest engine: ${inspect(
|
|
95
|
-
if (
|
|
96
|
-
configureLogger(
|
|
85
|
+
logger("Engine").debug(`Configuring Sidequest engine: ${inspect(nonNullConfig)}`);
|
|
86
|
+
if (nonNullConfig.logger) {
|
|
87
|
+
configureLogger(nonNullConfig.logger);
|
|
97
88
|
}
|
|
98
|
-
|
|
99
|
-
if (!
|
|
100
|
-
await
|
|
89
|
+
const backend = dependencyRegistry.register(Dependency.Backend, new LazyBackend(nonNullConfig.backend));
|
|
90
|
+
if (!nonNullConfig.skipMigration) {
|
|
91
|
+
await backend.migrate();
|
|
101
92
|
}
|
|
102
|
-
return
|
|
93
|
+
return nonNullConfig;
|
|
103
94
|
}
|
|
104
95
|
/**
|
|
105
96
|
* Validates the engine configuration settings.
|
|
@@ -118,17 +109,18 @@ class Engine {
|
|
|
118
109
|
* - Logs the resolved jobs file path when using manual job resolution
|
|
119
110
|
*/
|
|
120
111
|
validateConfig() {
|
|
121
|
-
|
|
112
|
+
const config = this.getConfig();
|
|
113
|
+
if (config.maxConcurrentJobs !== undefined && config.maxConcurrentJobs < 1) {
|
|
122
114
|
throw new Error(`Invalid "maxConcurrentJobs" value: must be at least 1.`);
|
|
123
115
|
}
|
|
124
|
-
if (
|
|
125
|
-
if (
|
|
126
|
-
const scriptUrl = resolveScriptPath(
|
|
116
|
+
if (config.manualJobResolution) {
|
|
117
|
+
if (config.jobsFilePath) {
|
|
118
|
+
const scriptUrl = resolveScriptPath(config.jobsFilePath);
|
|
127
119
|
if (!existsSync(fileURLToPath(scriptUrl))) {
|
|
128
120
|
throw new Error(`The specified jobsFilePath does not exist. Resolved to: ${scriptUrl}`);
|
|
129
121
|
}
|
|
130
|
-
logger("Engine").info(`Using manual jobs file at: ${
|
|
131
|
-
|
|
122
|
+
logger("Engine").info(`Using manual jobs file at: ${config.jobsFilePath}`);
|
|
123
|
+
config.jobsFilePath = scriptUrl;
|
|
132
124
|
}
|
|
133
125
|
else {
|
|
134
126
|
// This should throw an error if not found
|
|
@@ -145,11 +137,11 @@ class Engine {
|
|
|
145
137
|
logger("Engine").warn("Sidequest engine already started");
|
|
146
138
|
return;
|
|
147
139
|
}
|
|
148
|
-
await this.configure(config);
|
|
149
|
-
logger("Engine").info(`Starting Sidequest using backend ${
|
|
150
|
-
if (
|
|
151
|
-
for (const queue of
|
|
152
|
-
await grantQueueConfig(
|
|
140
|
+
const nonNullConfig = await this.configure(config);
|
|
141
|
+
logger("Engine").info(`Starting Sidequest using backend ${nonNullConfig.backend.driver}`);
|
|
142
|
+
if (nonNullConfig.queues) {
|
|
143
|
+
for (const queue of nonNullConfig.queues) {
|
|
144
|
+
await grantQueueConfig(dependencyRegistry.get(Dependency.Backend), queue, nonNullConfig.queueDefaults, true);
|
|
153
145
|
}
|
|
154
146
|
}
|
|
155
147
|
return new Promise((resolve, reject) => {
|
|
@@ -164,7 +156,7 @@ class Engine {
|
|
|
164
156
|
this.mainWorker.on("message", (msg) => {
|
|
165
157
|
if (msg === "ready") {
|
|
166
158
|
logger("Engine").debug("Main worker is ready");
|
|
167
|
-
this.mainWorker?.send({ type: "start", sidequestConfig:
|
|
159
|
+
this.mainWorker?.send({ type: "start", sidequestConfig: nonNullConfig });
|
|
168
160
|
clearTimeout(timeout);
|
|
169
161
|
resolve();
|
|
170
162
|
}
|
|
@@ -177,7 +169,7 @@ class Engine {
|
|
|
177
169
|
});
|
|
178
170
|
};
|
|
179
171
|
runWorker();
|
|
180
|
-
gracefulShutdown(this.close.bind(this), "Engine",
|
|
172
|
+
gracefulShutdown(this.close.bind(this), "Engine", nonNullConfig.gracefulShutdown);
|
|
181
173
|
}
|
|
182
174
|
});
|
|
183
175
|
}
|
|
@@ -186,14 +178,14 @@ class Engine {
|
|
|
186
178
|
* @returns The current configuration, if set.
|
|
187
179
|
*/
|
|
188
180
|
getConfig() {
|
|
189
|
-
return
|
|
181
|
+
return dependencyRegistry.get(Dependency.Config);
|
|
190
182
|
}
|
|
191
183
|
/**
|
|
192
184
|
* Gets the backend instance in use by the engine.
|
|
193
185
|
* @returns The backend instance, if set.
|
|
194
186
|
*/
|
|
195
187
|
getBackend() {
|
|
196
|
-
return
|
|
188
|
+
return dependencyRegistry.get(Dependency.Backend);
|
|
197
189
|
}
|
|
198
190
|
/**
|
|
199
191
|
* Closes the engine and releases resources.
|
|
@@ -212,19 +204,19 @@ class Engine {
|
|
|
212
204
|
await promise;
|
|
213
205
|
}
|
|
214
206
|
try {
|
|
215
|
-
await
|
|
207
|
+
await dependencyRegistry.get(Dependency.Backend)?.close();
|
|
216
208
|
}
|
|
217
209
|
catch (error) {
|
|
218
210
|
logger("Engine").error("Error closing backend:", error);
|
|
219
211
|
}
|
|
220
|
-
this.config = undefined;
|
|
221
|
-
this.backend = undefined;
|
|
222
212
|
this.mainWorker = undefined;
|
|
223
213
|
// Reset the shutting down flag after closing
|
|
224
214
|
// This allows the engine to be reconfigured or restarted later
|
|
225
215
|
clearGracefulShutdown();
|
|
226
216
|
logger("Engine").debug("Sidequest engine closed.");
|
|
227
217
|
this.shuttingDown = false;
|
|
218
|
+
// Clear the dependency registry to allow fresh configuration later
|
|
219
|
+
dependencyRegistry.clear();
|
|
228
220
|
}
|
|
229
221
|
}
|
|
230
222
|
/**
|
|
@@ -233,19 +225,21 @@ class Engine {
|
|
|
233
225
|
* @returns A new JobBuilder instance for the job class.
|
|
234
226
|
*/
|
|
235
227
|
build(JobClass) {
|
|
236
|
-
|
|
228
|
+
const backend = this.getBackend();
|
|
229
|
+
const config = this.getConfig();
|
|
230
|
+
if (!config || !backend) {
|
|
237
231
|
throw new Error("Engine not configured. Call engine.configure() or engine.start() first.");
|
|
238
232
|
}
|
|
239
233
|
if (this.shuttingDown) {
|
|
240
234
|
throw new Error("Engine is shutting down, cannot build job.");
|
|
241
235
|
}
|
|
242
236
|
logger("Engine").debug(`Building job for class: ${JobClass.name}`);
|
|
243
|
-
return new JobBuilder(
|
|
244
|
-
...
|
|
237
|
+
return new JobBuilder(backend, JobClass, {
|
|
238
|
+
...config.jobDefaults,
|
|
245
239
|
// We need to do this check again because available at is a getter. It needs to be set at job creation time.
|
|
246
240
|
// If not set, it will use the fallback value which is outdated from config.
|
|
247
|
-
availableAt:
|
|
248
|
-
},
|
|
241
|
+
availableAt: config.jobDefaults.availableAt ?? JOB_BUILDER_FALLBACK.availableAt,
|
|
242
|
+
}, config.manualJobResolution);
|
|
249
243
|
}
|
|
250
244
|
}
|
|
251
245
|
|
package/dist/engine.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.js","sources":["../src/engine.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"engine.js","sources":["../src/engine.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAmHA;;AAEG;MACU,MAAM,CAAA;AACjB;;;AAGG;AACK,IAAA,UAAU;AAElB;;;AAGG;IACK,YAAY,GAAG,KAAK;AAE5B;;;;AAIG;IACH,MAAM,SAAS,CAAC,MAAqB,EAAA;AACnC,QAAA,IAAI,IAAI,CAAC,SAAS,EAAE,EAAE;YACpB,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,8BAA8B,CAAC;AACtD,YAAA,OAAO,IAAI,CAAC,SAAS,EAAG;QAC1B;AACA,QAAA,MAAM,aAAa,GAA4B;AAC7C,YAAA,MAAM,EAAE,MAAM,EAAE,MAAM,IAAI,EAAE;AAC5B,YAAA,OAAO,EAAE;AACP,gBAAA,MAAM,EAAE,MAAM,EAAE,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GAAG,SAAS;;;AAG3B,YAAA,qBAAqB,EAAE;YACvB,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,0BAA0B,CAAC;AAClD,YAAA,IAAI,CAAC,YAAY,GAAG,KAAK;;YAEzB,kBAAkB,CAAC,KAAK,EAAE;QAC5B;IACF;AAEA;;;;AAIG;AACH,IAAA,KAAK,CAAyB,QAAW,EAAA;AACvC,QAAA,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE;AACjC,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE;AAC/B,QAAA,IAAI,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE;AACvB,YAAA,MAAM,IAAI,KAAK,CAAC,yEAAyE,CAAC;QAC5F;AACA,QAAA,IAAI,IAAI,CAAC,YAAY,EAAE;AACrB,YAAA,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC;QAC/D;AACA,QAAA,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAA,wBAAA,EAA2B,QAAQ,CAAC,IAAI,CAAA,CAAE,CAAC;AAClE,QAAA,OAAO,IAAI,UAAU,CACnB,OAAO,EACP,QAAQ,EACR;YACE,GAAG,MAAM,CAAC,WAAW;;;YAGrB,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,WAAW,IAAI,oBAAoB,CAAC,WAAY;AACjF,SAAA,EACD,MAAM,CAAC,mBAAmB,CAC3B;IACH;AACD;;;;"}
|
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
var core = require('@sidequest/core');
|
|
4
4
|
var util = require('util');
|
|
5
|
+
require('../job/constants.cjs');
|
|
6
|
+
require('node-cron');
|
|
7
|
+
require('node:util');
|
|
8
|
+
require('node:fs');
|
|
9
|
+
require('node:url');
|
|
10
|
+
require('node:path');
|
|
11
|
+
require('piscina');
|
|
12
|
+
require('../constants.cjs');
|
|
13
|
+
var jobTransitioner = require('../job/job-transitioner.cjs');
|
|
5
14
|
|
|
6
15
|
/**
|
|
7
16
|
* Finds and releases stale jobs, making them available for processing again.
|
|
@@ -16,8 +25,17 @@ async function releaseStaleJobs(backend, maxStaleMs, maxClaimedMs) {
|
|
|
16
25
|
core.logger("Engine").info(`Stale jobs found, making them available to process`);
|
|
17
26
|
core.logger("Engine").debug(`Stale jobs: ${util.inspect(staleJobs)}`);
|
|
18
27
|
for (const jobData of staleJobs) {
|
|
19
|
-
jobData.state
|
|
20
|
-
|
|
28
|
+
if (jobData.state === "running") {
|
|
29
|
+
// We need to use the JobTransitioner to properly handle retries and state transitions
|
|
30
|
+
// This fixes the issue where the release of a stale job incremented the retry count and
|
|
31
|
+
// did not respect the maxRetries setting.
|
|
32
|
+
await jobTransitioner.JobTransitioner.apply(backend, jobData, new core.RetryTransition("Stale job released for retry"));
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
// If it's "claimed", then the attempt count was not incremented, so we can just set it back to "waiting"
|
|
36
|
+
jobData.state = "waiting";
|
|
37
|
+
await backend.updateJob(jobData);
|
|
38
|
+
}
|
|
21
39
|
}
|
|
22
40
|
}
|
|
23
41
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-stale-jobs.cjs","sources":["../../src/routines/release-stale-jobs.ts"],"sourcesContent":[null],"names":["logger","inspect"],"mappings":"
|
|
1
|
+
{"version":3,"file":"release-stale-jobs.cjs","sources":["../../src/routines/release-stale-jobs.ts"],"sourcesContent":[null],"names":["logger","inspect","JobTransitioner","RetryTransition"],"mappings":";;;;;;;;;;;;;;AAKA;;;;;;AAMG;AACI,eAAe,gBAAgB,CAAC,OAAgB,EAAE,UAAkB,EAAE,YAAoB,EAAA;IAC/F,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,UAAU,EAAE,YAAY,CAAC;AAEnE,IAAA,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;QACxBA,WAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAA,kDAAA,CAAoD,CAAC;AAC3E,QAAAA,WAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAA,YAAA,EAAeC,YAAO,CAAC,SAAS,CAAC,CAAA,CAAE,CAAC;AAC3D,QAAA,KAAK,MAAM,OAAO,IAAI,SAAS,EAAE;AAC/B,YAAA,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS,EAAE;;;;AAI/B,gBAAA,MAAMC,+BAAe,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,IAAIC,oBAAe,CAAC,8BAA8B,CAAC,CAAC;YACpG;iBAAO;;AAEL,gBAAA,OAAO,CAAC,KAAK,GAAG,SAAS;AACzB,gBAAA,MAAM,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC;YAClC;QACF;IACF;SAAO;QACLH,WAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAA,mBAAA,CAAqB,CAAC;IAC/C;AACF;;;;"}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import { logger } from '@sidequest/core';
|
|
1
|
+
import { logger, RetryTransition } from '@sidequest/core';
|
|
2
2
|
import { inspect } from 'util';
|
|
3
|
+
import '../job/constants.js';
|
|
4
|
+
import 'node-cron';
|
|
5
|
+
import 'node:util';
|
|
6
|
+
import 'node:fs';
|
|
7
|
+
import 'node:url';
|
|
8
|
+
import 'node:path';
|
|
9
|
+
import 'piscina';
|
|
10
|
+
import '../constants.js';
|
|
11
|
+
import { JobTransitioner } from '../job/job-transitioner.js';
|
|
3
12
|
|
|
4
13
|
/**
|
|
5
14
|
* Finds and releases stale jobs, making them available for processing again.
|
|
@@ -14,8 +23,17 @@ async function releaseStaleJobs(backend, maxStaleMs, maxClaimedMs) {
|
|
|
14
23
|
logger("Engine").info(`Stale jobs found, making them available to process`);
|
|
15
24
|
logger("Engine").debug(`Stale jobs: ${inspect(staleJobs)}`);
|
|
16
25
|
for (const jobData of staleJobs) {
|
|
17
|
-
jobData.state
|
|
18
|
-
|
|
26
|
+
if (jobData.state === "running") {
|
|
27
|
+
// We need to use the JobTransitioner to properly handle retries and state transitions
|
|
28
|
+
// This fixes the issue where the release of a stale job incremented the retry count and
|
|
29
|
+
// did not respect the maxRetries setting.
|
|
30
|
+
await JobTransitioner.apply(backend, jobData, new RetryTransition("Stale job released for retry"));
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
// If it's "claimed", then the attempt count was not incremented, so we can just set it back to "waiting"
|
|
34
|
+
jobData.state = "waiting";
|
|
35
|
+
await backend.updateJob(jobData);
|
|
36
|
+
}
|
|
19
37
|
}
|
|
20
38
|
}
|
|
21
39
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-stale-jobs.js","sources":["../../src/routines/release-stale-jobs.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"release-stale-jobs.js","sources":["../../src/routines/release-stale-jobs.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;AAKA;;;;;;AAMG;AACI,eAAe,gBAAgB,CAAC,OAAgB,EAAE,UAAkB,EAAE,YAAoB,EAAA;IAC/F,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,UAAU,EAAE,YAAY,CAAC;AAEnE,IAAA,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;QACxB,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAA,kDAAA,CAAoD,CAAC;AAC3E,QAAA,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAA,YAAA,EAAe,OAAO,CAAC,SAAS,CAAC,CAAA,CAAE,CAAC;AAC3D,QAAA,KAAK,MAAM,OAAO,IAAI,SAAS,EAAE;AAC/B,YAAA,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS,EAAE;;;;AAI/B,gBAAA,MAAM,eAAe,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,eAAe,CAAC,8BAA8B,CAAC,CAAC;YACpG;iBAAO;;AAEL,gBAAA,OAAO,CAAC,KAAK,GAAG,SAAS;AACzB,gBAAA,MAAM,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC;YAClC;QACF;IACF;SAAO;QACL,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAA,mBAAA,CAAqB,CAAC;IAC/C;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sidequest/engine",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.5",
|
|
4
4
|
"description": "@sidequest/engine is the core engine of SideQuest, a distributed background job processing system for Node.js and TypeScript.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nodejs",
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
},
|
|
43
43
|
"license": "LGPL-3.0-or-later",
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@sidequest/backend": "1.13.
|
|
46
|
-
"@sidequest/core": "1.13.
|
|
45
|
+
"@sidequest/backend": "1.13.5",
|
|
46
|
+
"@sidequest/core": "1.13.5",
|
|
47
47
|
"node-cron": "^4.2.1",
|
|
48
48
|
"piscina": "^5.1.3"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"sidequest": "1.13.
|
|
51
|
+
"sidequest": "1.13.5"
|
|
52
52
|
}
|
|
53
53
|
}
|