navi-hey 1.14.1 → 1.14.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/README.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# Navi
|
|
2
2
|
|
|
3
3
|
[](https://circleci.com/gh/darthjee/navi)
|
|
4
|
+
[](https://github.com/darthjee/navi/releases/tag/1.14.2)
|
|
5
|
+
[](https://www.npmjs.com/package/navi-hey)
|
|
6
|
+
[](https://hub.docker.com/repository/docker/darthjee/navi-hey/general)
|
|
7
|
+
|
|
8
|
+
[](https://www.npmjs.com/package/deku-swarm)
|
|
9
|
+
[](https://www.npmjs.com/package/deku-sprout)
|
|
4
10
|
|
|
5
11
|
Cache Warmer Tool
|
|
6
12
|
|
|
@@ -46,6 +46,7 @@ class ApplicationInstance {
|
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* Loads the configuration from the specified file path.
|
|
49
|
+
* Workers built from it wake the engine (once it exists) whenever they become idle.
|
|
49
50
|
* @param {string} configPath - The path to the configuration file.
|
|
50
51
|
* @param {string} [menuPath] - The path to the menu configuration file.
|
|
51
52
|
* @throws {ConfigurationFileNotProvided} If the configuration file path is not provided.
|
|
@@ -55,7 +56,10 @@ class ApplicationInstance {
|
|
|
55
56
|
*/
|
|
56
57
|
loadConfig(configPath, menuPath) {
|
|
57
58
|
this.#configStore = this.#configurator.load(configPath, menuPath);
|
|
58
|
-
this.#registriesBuilder.build({
|
|
59
|
+
this.#registriesBuilder.build({
|
|
60
|
+
config: this.config,
|
|
61
|
+
onWorkerIdle: () => this.#engineController?.engine?.wake(),
|
|
62
|
+
});
|
|
59
63
|
}
|
|
60
64
|
|
|
61
65
|
/**
|
|
@@ -22,9 +22,10 @@ class RegistriesBuilder {
|
|
|
22
22
|
* Registers all job factories and builds the parser, job, and workers registries.
|
|
23
23
|
* @param {object} params - Construction parameters.
|
|
24
24
|
* @param {Config} params.config - The loaded application configuration.
|
|
25
|
+
* @param {Function} [params.onWorkerIdle] - Called with no arguments whenever a worker becomes idle after a job (wired to Engine#wake()).
|
|
25
26
|
* @returns {void}
|
|
26
27
|
*/
|
|
27
|
-
build({ config }) {
|
|
28
|
+
build({ config, onWorkerIdle }) {
|
|
28
29
|
const { maxRetries, retryCooldown: cooldown } = config.workersConfig;
|
|
29
30
|
|
|
30
31
|
JobFactory.build('ResourceRequestJob', { klass: ResourceRequestJob, attributes: { clients: config.namespaceMap, maxRetries, cooldown } });
|
|
@@ -46,7 +47,7 @@ class RegistriesBuilder {
|
|
|
46
47
|
const loggerFactory = ({ workerId, jobId }) => new LogContext({ workerId, jobId });
|
|
47
48
|
|
|
48
49
|
WorkersRegistry.ensureBuild({
|
|
49
|
-
factory: new WorkerFactory({ jobRegistry: JobRegistry, workersRegistry: WorkersRegistry, loggerFactory }),
|
|
50
|
+
factory: new WorkerFactory({ jobRegistry: JobRegistry, workersRegistry: WorkersRegistry, loggerFactory, onWorkerIdle }),
|
|
50
51
|
...config.workersConfig,
|
|
51
52
|
});
|
|
52
53
|
WorkersRegistry.initWorkers();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "navi-hey",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.14.
|
|
4
|
+
"version": "1.14.2",
|
|
5
5
|
"description": "Navi cache warmer CLI",
|
|
6
6
|
"readme": "README.md",
|
|
7
7
|
"main": "index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"axios": "^1.13.0",
|
|
37
37
|
"deku-sprout": "0.3.0",
|
|
38
|
-
"deku-swarm": "1.
|
|
38
|
+
"deku-swarm": "1.13.0",
|
|
39
39
|
"express": "5.2.1",
|
|
40
40
|
"node-html-parser": "7.1.0",
|
|
41
41
|
"yaml": "^2.8.2"
|