zyket 1.2.8 → 1.2.9
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
|
@@ -11,7 +11,9 @@ module.exports = class Cache extends Service {
|
|
|
11
11
|
constructor(container, url) {
|
|
12
12
|
super("cache");
|
|
13
13
|
this.#container = container;
|
|
14
|
-
|
|
14
|
+
// Check if URL is a valid Redis URL (starts with redis://)
|
|
15
|
+
// Empty string, 'memory', or 'in-memory' will use in-memory cache
|
|
16
|
+
this.#useRedis = !!url && url.startsWith('redis://');
|
|
15
17
|
|
|
16
18
|
if (this.#useRedis) {
|
|
17
19
|
this.#client = createClient({ url });
|
package/src/services/index.js
CHANGED
|
@@ -8,8 +8,7 @@ const EventService = require("./events");
|
|
|
8
8
|
|
|
9
9
|
const eventsActivated = process.env.DISABLE_EVENTS !== 'true';
|
|
10
10
|
const databaseActivated = !!process.env.DATABASE_URL;
|
|
11
|
-
const
|
|
12
|
-
const bullmqActivated = !!process.env.CACHE_URL && process.env.DISABLE_BULLMQ !== 'true';
|
|
11
|
+
const bullmqActivated = process.env.DISABLE_BULLMQ !== 'true';
|
|
13
12
|
const s3Activated = process.env.S3_ENDPOINT && process.env.S3_ACCESS_KEY && process.env.S3_SECRET_KEY;
|
|
14
13
|
const schedulerActivated = process.env.DISABLE_SCHEDULER !== 'true';
|
|
15
14
|
const socketActivated = process.env.DISABLE_SOCKET !== 'true';
|
|
@@ -21,7 +20,7 @@ module.exports = [
|
|
|
21
20
|
["template-manager", require("./template-manager"), []],
|
|
22
21
|
eventsActivated ? ["events", EventService, ["@service_container"]] : null,
|
|
23
22
|
databaseActivated ? ["database", Database, ["@service_container", process.env.DATABASE_URL]] : null,
|
|
24
|
-
|
|
23
|
+
["cache", Cache, ["@service_container", process.env.CACHE_URL || '']],
|
|
25
24
|
s3Activated ? ["s3", S3, ["@service_container", process.env.S3_ENDPOINT, process.env.S3_PORT, process.env.S3_USE_SSL === "true", process.env.S3_ACCESS_KEY, process.env.S3_SECRET_KEY]] : null,
|
|
26
25
|
schedulerActivated ? ["scheduler", Scheduler, ["@service_container"]] : null,
|
|
27
26
|
bullmqActivated ? ["bullmq", require("./bullmq"), ["@service_container"]] : null,
|
package/src/utils/EnvManager.js
CHANGED
|
@@ -13,8 +13,7 @@ module.exports = class EnvManager {
|
|
|
13
13
|
|
|
14
14
|
static getDefaultSecrets() {
|
|
15
15
|
const header = `# Zyket Environment Configuration
|
|
16
|
-
# Leave
|
|
17
|
-
|
|
16
|
+
# CACHE_URL: Leave empty or set to 'memory' for in-memory cache, or 'redis://localhost:6379' for Redis
|
|
18
17
|
`;
|
|
19
18
|
const envsToCreate = {
|
|
20
19
|
DEBUG: true,
|