@paroicms/server-text-cache-system 1.9.2 → 1.10.1
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/cache-system.d.ts +2 -2
- package/dist/cache-system.js +5 -5
- package/dist/db-init/db-init.d.ts +3 -3
- package/dist/db-init/db-init.js +6 -6
- package/dist/db-init/db-init.js.map +1 -1
- package/dist/db-init/ddl-migration.d.ts +3 -3
- package/dist/db-init/ddl-migration.js +4 -4
- package/dist/db-init/ddl-migration.js.map +1 -1
- package/dist/internal/cache-system-context.d.ts +2 -2
- package/dist/internal/cache-system-context.js +1 -1
- package/dist/internal/queries.d.ts +1 -1
- package/dist/internal/queries.js +2 -2
- package/dist/internal/scheduler.js +7 -7
- package/package.json +7 -7
package/dist/cache-system.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AppLogger, Tracker } from "@paroicms/internal-server-lib";
|
|
2
2
|
import type { CacheSetData, CacheValue, TextCacheSystemStorage } from "./public-types";
|
|
3
3
|
export declare const allDependencyKey = "all";
|
|
4
4
|
export interface CreateTextCacheSystemOptions {
|
|
5
5
|
appVersion: string;
|
|
6
6
|
storage: TextCacheSystemStorage;
|
|
7
|
-
|
|
7
|
+
logger: AppLogger;
|
|
8
8
|
/**
|
|
9
9
|
* For example: `"14d"`. Leave `undefined` to keep cache data undefinitely.
|
|
10
10
|
*/
|
package/dist/cache-system.js
CHANGED
|
@@ -24,7 +24,7 @@ async function createTextCacheSystem(options) {
|
|
|
24
24
|
checkStatus();
|
|
25
25
|
const value = await (0, queries_1.getCacheValue)(context, cacheKey, tracker);
|
|
26
26
|
if (value !== undefined) {
|
|
27
|
-
context.
|
|
27
|
+
context.logger.debug(`found cache: ${cacheKey}`);
|
|
28
28
|
}
|
|
29
29
|
return value;
|
|
30
30
|
},
|
|
@@ -38,7 +38,7 @@ async function createTextCacheSystem(options) {
|
|
|
38
38
|
dependencyKeys: [exports.allDependencyKey, ...dependencyKeys],
|
|
39
39
|
});
|
|
40
40
|
if (cacheKeys.length > 0) {
|
|
41
|
-
context.
|
|
41
|
+
context.logger.debug(`${cacheKeys.length} invalidated cache: ${cacheKeys.join(", ")}`);
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
async scheduleInvalidation(eventKey, dependencyKeys, scheduledAt) {
|
|
@@ -59,18 +59,18 @@ async function createTextCacheSystem(options) {
|
|
|
59
59
|
checkStatus();
|
|
60
60
|
const count = await (0, queries_1.deleteUnusedCacheValues)(context);
|
|
61
61
|
if (count !== undefined && count > 0) {
|
|
62
|
-
context.
|
|
62
|
+
context.logger.debug(`${count} unused cache values were deleted`);
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
async invalidateAll() {
|
|
66
66
|
checkStatus();
|
|
67
67
|
await (0, queries_1.invalidateAllCacheValues)(context);
|
|
68
|
-
context.
|
|
68
|
+
context.logger.debug("cache is fully invalidated");
|
|
69
69
|
},
|
|
70
70
|
async clearCache() {
|
|
71
71
|
checkStatus();
|
|
72
72
|
await (0, queries_1.clearCacheValues)(context);
|
|
73
|
-
context.
|
|
73
|
+
context.logger.debug("cache is cleared");
|
|
74
74
|
},
|
|
75
75
|
async close() {
|
|
76
76
|
if (context.status === "destroyed")
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type AppLogger } from "@paroicms/internal-server-lib";
|
|
2
2
|
import type { DataSource } from "typeorm";
|
|
3
|
-
export declare function createOrOpenConnection({ sqliteFile, appVersion,
|
|
3
|
+
export declare function createOrOpenConnection({ sqliteFile, appVersion, logger, }: {
|
|
4
4
|
sqliteFile: string;
|
|
5
5
|
appVersion: string;
|
|
6
|
-
|
|
6
|
+
logger: AppLogger;
|
|
7
7
|
}): Promise<{
|
|
8
8
|
cn: DataSource;
|
|
9
9
|
logNextQuery: (count?: number) => void;
|
package/dist/db-init/db-init.js
CHANGED
|
@@ -8,8 +8,8 @@ const queries_1 = require("../internal/queries");
|
|
|
8
8
|
const ddl_migration_1 = require("./ddl-migration");
|
|
9
9
|
const PaTextCache_entity_1 = require("./entities/PaTextCache.entity");
|
|
10
10
|
const PaTextCacheDependency_entity_1 = require("./entities/PaTextCacheDependency.entity");
|
|
11
|
-
async function createOrOpenConnection({ sqliteFile, appVersion,
|
|
12
|
-
const { logNextQuery, typeOrmLogger } = (0, internal_server_lib_1.createSqlLogger)({
|
|
11
|
+
async function createOrOpenConnection({ sqliteFile, appVersion, logger, }) {
|
|
12
|
+
const { logNextQuery, typeOrmLogger } = (0, internal_server_lib_1.createSqlLogger)({ logger, dbSchemaName: ddl_migration_1.dbSchemaName });
|
|
13
13
|
const { cn, isNewDb, migrationReport } = await (0, internal_server_lib_1.createOrOpenSqliteConnection)({
|
|
14
14
|
canCreate: true,
|
|
15
15
|
dbSchemaName: ddl_migration_1.dbSchemaName,
|
|
@@ -17,8 +17,8 @@ async function createOrOpenConnection({ sqliteFile, appVersion, appLog, }) {
|
|
|
17
17
|
ddlFile: (0, node_path_1.join)(constants_1.packageDir, "ddl", "text-cache.ddl.sql"),
|
|
18
18
|
migrateDb,
|
|
19
19
|
entities: [PaTextCache_entity_1.PaTextCacheEntity, PaTextCacheDependency_entity_1.PaTextCacheDependencyEntity],
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
typeOrmLogger,
|
|
21
|
+
logger,
|
|
22
22
|
});
|
|
23
23
|
let isCleared = isNewDb || migrationReport.migrated;
|
|
24
24
|
const storedAppVersion = await (0, internal_server_lib_1.getMetadataValue)(cn, { dbSchemaName: ddl_migration_1.dbSchemaName, key: "appVersion" });
|
|
@@ -29,7 +29,7 @@ async function createOrOpenConnection({ sqliteFile, appVersion, appLog, }) {
|
|
|
29
29
|
}
|
|
30
30
|
await (0, internal_server_lib_1.setMetadataValue)(cn, { dbSchemaName: ddl_migration_1.dbSchemaName, key: "appVersion", value: appVersion });
|
|
31
31
|
if (storedAppVersion !== undefined) {
|
|
32
|
-
|
|
32
|
+
logger.info(`Cleared text cache due to app version change from ${storedAppVersion} to ${appVersion}`);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
async function migrateDb(cn) {
|
|
@@ -42,7 +42,7 @@ async function createOrOpenConnection({ sqliteFile, appVersion, appLog, }) {
|
|
|
42
42
|
}
|
|
43
43
|
await (0, ddl_migration_1.migrateTextCacheDb)(cn, {
|
|
44
44
|
fromVersion: dbVersion,
|
|
45
|
-
|
|
45
|
+
logger,
|
|
46
46
|
});
|
|
47
47
|
return {
|
|
48
48
|
migrated: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-init.js","sourceRoot":"","sources":["../../src/db-init/db-init.ts"],"names":[],"mappings":";;AAiBA,wDAsDC;AAvED,yCAAiC;AACjC,uEAQuC;AAEvC,4CAA0C;AAC1C,iDAAuD;AACvD,mDAA2F;AAC3F,sEAAkE;AAClE,0FAAsF;AAE/E,KAAK,UAAU,sBAAsB,CAAC,EAC3C,UAAU,EACV,UAAU,EACV,MAAM,
|
|
1
|
+
{"version":3,"file":"db-init.js","sourceRoot":"","sources":["../../src/db-init/db-init.ts"],"names":[],"mappings":";;AAiBA,wDAsDC;AAvED,yCAAiC;AACjC,uEAQuC;AAEvC,4CAA0C;AAC1C,iDAAuD;AACvD,mDAA2F;AAC3F,sEAAkE;AAClE,0FAAsF;AAE/E,KAAK,UAAU,sBAAsB,CAAC,EAC3C,UAAU,EACV,UAAU,EACV,MAAM,GACwD;IAC9D,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,IAAA,qCAAe,EAAC,EAAE,MAAM,EAAE,YAAY,EAAZ,4BAAY,EAAE,CAAC,CAAC;IAElF,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,MAAM,IAAA,kDAA4B,EAAC;QAC1E,SAAS,EAAE,IAAI;QACf,YAAY,EAAZ,4BAAY;QACZ,UAAU;QACV,OAAO,EAAE,IAAA,gBAAI,EAAC,sBAAU,EAAE,KAAK,EAAE,oBAAoB,CAAC;QACtD,SAAS;QACT,QAAQ,EAAE,CAAC,sCAAiB,EAAE,0DAA2B,CAAC;QAC1D,aAAa;QACb,MAAM;KACP,CAAC,CAAC;IAEH,IAAI,SAAS,GAAG,OAAO,IAAI,eAAe,CAAC,QAAQ,CAAC;IAEpD,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAAgB,EAAC,EAAE,EAAE,EAAE,YAAY,EAAZ,4BAAY,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC,CAAC;IACzF,IAAI,gBAAgB,KAAK,UAAU,EAAE,CAAC;QACpC,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAA,0BAAgB,EAAC,EAAE,EAAE,EAAE,CAAC,CAAC;YAC/B,SAAS,GAAG,IAAI,CAAC;QACnB,CAAC;QACD,MAAM,IAAA,sCAAgB,EAAC,EAAE,EAAE,EAAE,YAAY,EAAZ,4BAAY,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;QACnF,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;YACnC,MAAM,CAAC,IAAI,CACT,qDAAqD,gBAAgB,OAAO,UAAU,EAAE,CACzF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,KAAK,UAAU,SAAS,CAAC,EAAc;QACrC,MAAM,SAAS,GAAG,MAAM,IAAA,gDAA0B,EAAC,EAAE,EAAE,EAAE,YAAY,EAAZ,4BAAY,EAAE,CAAC,CAAC;QACzE,IAAI,SAAS,KAAK,sCAAsB,EAAE,CAAC;YACzC,OAAO;gBACL,QAAQ,EAAE,KAAK;gBACf,aAAa,EAAE,SAAS;aACzB,CAAC;QACJ,CAAC;QACD,MAAM,IAAA,kCAAkB,EAAC,EAAE,EAAE;YAC3B,WAAW,EAAE,SAAS;YACtB,MAAM;SACP,CAAC,CAAC;QACH,OAAO;YACL,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,SAAS;YACtB,aAAa,EAAE,sCAAsB;SACtC,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;AACzC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AppLogger } from "@paroicms/public-server-lib";
|
|
2
2
|
import type { DataSource } from "typeorm";
|
|
3
3
|
export declare const dbSchemaName = "text-cache";
|
|
4
4
|
export declare const currentDbSchemaVersion = 3;
|
|
5
|
-
export declare function migrateTextCacheDb(cn: DataSource, { fromVersion,
|
|
5
|
+
export declare function migrateTextCacheDb(cn: DataSource, { fromVersion, logger }: {
|
|
6
6
|
fromVersion: number;
|
|
7
|
-
|
|
7
|
+
logger: AppLogger;
|
|
8
8
|
}): Promise<void>;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.currentDbSchemaVersion = exports.dbSchemaName = void 0;
|
|
4
4
|
exports.migrateTextCacheDb = migrateTextCacheDb;
|
|
5
|
-
const internal_server_lib_1 = require("@paroicms/internal-server-lib");
|
|
6
5
|
const node_path_1 = require("node:path");
|
|
6
|
+
const internal_server_lib_1 = require("@paroicms/internal-server-lib");
|
|
7
7
|
const constants_1 = require("../constants");
|
|
8
8
|
exports.dbSchemaName = "text-cache";
|
|
9
9
|
exports.currentDbSchemaVersion = 3;
|
|
10
|
-
async function migrateTextCacheDb(cn, { fromVersion,
|
|
10
|
+
async function migrateTextCacheDb(cn, { fromVersion, logger }) {
|
|
11
11
|
const toVersion = exports.currentDbSchemaVersion;
|
|
12
12
|
let currentVersion = fromVersion;
|
|
13
13
|
if (currentVersion <= 2) {
|
|
@@ -18,13 +18,13 @@ async function migrateTextCacheDb(cn, { fromVersion, appLog }) {
|
|
|
18
18
|
}
|
|
19
19
|
// We don't care losing cache data
|
|
20
20
|
if (currentVersion < toVersion) {
|
|
21
|
-
|
|
21
|
+
logger.info("reset the text-cache database");
|
|
22
22
|
await (0, internal_server_lib_1.executeDdl)(cn, (0, node_path_1.join)(constants_1.packageDir, "ddl", "text-cache.ddl.sql"));
|
|
23
23
|
currentVersion = await (0, internal_server_lib_1.getMetadataDbSchemaVersion)(cn, { dbSchemaName: exports.dbSchemaName });
|
|
24
24
|
}
|
|
25
25
|
if (currentVersion !== toVersion) {
|
|
26
26
|
throw new Error(`version of ${exports.dbSchemaName} database should be '${toVersion}', but is '${currentVersion}'`);
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
logger.info(`${exports.dbSchemaName} database was migrated from ${fromVersion} to ${currentVersion}`);
|
|
29
29
|
}
|
|
30
30
|
//# sourceMappingURL=ddl-migration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ddl-migration.js","sourceRoot":"","sources":["../../src/db-init/ddl-migration.ts"],"names":[],"mappings":";;;AASA,gDA2BC;AApCD,
|
|
1
|
+
{"version":3,"file":"ddl-migration.js","sourceRoot":"","sources":["../../src/db-init/ddl-migration.ts"],"names":[],"mappings":";;;AASA,gDA2BC;AApCD,yCAAiC;AACjC,uEAAuF;AAGvF,4CAA0C;AAE7B,QAAA,YAAY,GAAG,YAAY,CAAC;AAC5B,QAAA,sBAAsB,GAAG,CAAC,CAAC;AAEjC,KAAK,UAAU,kBAAkB,CACtC,EAAc,EACd,EAAE,WAAW,EAAE,MAAM,EAA8C;IAEnE,MAAM,SAAS,GAAG,8BAAsB,CAAC;IACzC,IAAI,cAAc,GAAG,WAAW,CAAC;IAEjC,IAAI,cAAc,IAAI,CAAC,EAAE,CAAC;QACxB,MAAM,EAAE,CAAC,KAAK,CAAC,uDAAuD,CAAC,CAAC;QACxE,MAAM,EAAE,CAAC,KAAK,CAAC,uDAAuD,CAAC,CAAC;QACxE,MAAM,EAAE,CAAC,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAC7D,MAAM,EAAE,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACrD,CAAC;IAED,kCAAkC;IAClC,IAAI,cAAc,GAAG,SAAS,EAAE,CAAC;QAC/B,MAAM,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;QAC7C,MAAM,IAAA,gCAAU,EAAC,EAAE,EAAE,IAAA,gBAAI,EAAC,sBAAU,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC;QACpE,cAAc,GAAG,MAAM,IAAA,gDAA0B,EAAC,EAAE,EAAE,EAAE,YAAY,EAAZ,oBAAY,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CACb,cAAc,oBAAY,wBAAwB,SAAS,cAAc,cAAc,GAAG,CAC3F,CAAC;IACJ,CAAC;IACD,MAAM,CAAC,IAAI,CAAC,GAAG,oBAAY,+BAA+B,WAAW,OAAO,cAAc,EAAE,CAAC,CAAC;AAChG,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AppLogger } from "@paroicms/internal-server-lib";
|
|
2
2
|
import type { DataSource } from "typeorm";
|
|
3
3
|
import type { CreateTextCacheSystemOptions } from "../cache-system";
|
|
4
4
|
import type { TextCacheSystemStorage } from "../public-types";
|
|
5
5
|
import { type InvalidationScheduler } from "./scheduler";
|
|
6
6
|
export interface TextCacheSystemContext extends CreateTextCacheSystemOptions {
|
|
7
7
|
status: "ready" | "destroyed";
|
|
8
|
-
|
|
8
|
+
logger: AppLogger;
|
|
9
9
|
cn: DataSource;
|
|
10
10
|
storage: TextCacheSystemStorage;
|
|
11
11
|
logNextQuery: (count?: number) => void;
|
|
@@ -8,7 +8,7 @@ async function createTextCacheSystemContext(options) {
|
|
|
8
8
|
const { cn, logNextQuery, isCleared } = await (0, db_init_1.createOrOpenConnection)({
|
|
9
9
|
appVersion: options.appVersion,
|
|
10
10
|
sqliteFile: options.storage.file,
|
|
11
|
-
|
|
11
|
+
logger: options.logger,
|
|
12
12
|
});
|
|
13
13
|
const context = {
|
|
14
14
|
...options,
|
|
@@ -2,7 +2,7 @@ import { type QueryBuilderConnection, type Tracker } from "@paroicms/internal-se
|
|
|
2
2
|
import type { CacheSetData, CacheValue } from "../public-types";
|
|
3
3
|
import type { TextCacheSystemContext } from "./cache-system-context";
|
|
4
4
|
export declare function insertOrUpdateCacheValue(cn: QueryBuilderConnection, data: CacheSetData, tracker: Tracker): Promise<CacheValue>;
|
|
5
|
-
export declare function getCacheValue({ cn, timeToIdleDays,
|
|
5
|
+
export declare function getCacheValue({ cn, timeToIdleDays, logger }: TextCacheSystemContext, cacheKey: string, tracker: Tracker): Promise<CacheValue | undefined>;
|
|
6
6
|
export declare function getDependencyKeys({ cn }: TextCacheSystemContext, cacheKey: string, tracker: Tracker): Promise<string[]>;
|
|
7
7
|
/**
|
|
8
8
|
* @returns the list of cache cacheKeys that were deleted
|
package/dist/internal/queries.js
CHANGED
|
@@ -48,7 +48,7 @@ async function insertOrUpdateCacheValue(cn, data, tracker) {
|
|
|
48
48
|
value: data.value,
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
async function getCacheValue({ cn, timeToIdleDays,
|
|
51
|
+
async function getCacheValue({ cn, timeToIdleDays, logger }, cacheKey, tracker) {
|
|
52
52
|
const row = await cn
|
|
53
53
|
.createQueryBuilder()
|
|
54
54
|
.select("c.val", "val")
|
|
@@ -62,7 +62,7 @@ async function getCacheValue({ cn, timeToIdleDays, appLog }, cacheKey, tracker)
|
|
|
62
62
|
return;
|
|
63
63
|
const readAt = (0, data_formatters_lib_1.dateVal)(row.readAt);
|
|
64
64
|
if (timeToIdleDays !== undefined && !(0, internal_anywhere_lib_1.isSameTimeUnit)(readAt, "day")) {
|
|
65
|
-
|
|
65
|
+
logger.debug(`updating readAt of cache: ${cacheKey}`);
|
|
66
66
|
await cn
|
|
67
67
|
.createQueryBuilder()
|
|
68
68
|
.update("PaTextCache")
|
|
@@ -33,7 +33,7 @@ async function run(context, variables) {
|
|
|
33
33
|
let errorCount = 0;
|
|
34
34
|
while (1) {
|
|
35
35
|
try {
|
|
36
|
-
context.
|
|
36
|
+
context.logger.debug("Process scheduled invalidations now…");
|
|
37
37
|
if (variables.currentWait) {
|
|
38
38
|
variables.currentWait.cancel();
|
|
39
39
|
variables.currentWait = undefined;
|
|
@@ -47,7 +47,7 @@ async function run(context, variables) {
|
|
|
47
47
|
suspiciousDelayCount = 0;
|
|
48
48
|
}
|
|
49
49
|
else if (++suspiciousDelayCount > 5) {
|
|
50
|
-
context.
|
|
50
|
+
context.logger.error(`Too many negative delays (${delayMs}ms), stop the scheduler`);
|
|
51
51
|
break;
|
|
52
52
|
}
|
|
53
53
|
if (delayMs < 500) {
|
|
@@ -57,7 +57,7 @@ async function run(context, variables) {
|
|
|
57
57
|
delayMs = MAX_DELAY_MS;
|
|
58
58
|
}
|
|
59
59
|
variables.currentWait = (0, async_utils_1.waitOrCancel)(delayMs);
|
|
60
|
-
context.
|
|
60
|
+
context.logger.debug(`Next scheduled invalidations at ${scheduledAt.toISOString()}`);
|
|
61
61
|
const shouldStop = await variables.currentWait.promise;
|
|
62
62
|
variables.currentWait = undefined;
|
|
63
63
|
if (shouldStop)
|
|
@@ -65,9 +65,9 @@ async function run(context, variables) {
|
|
|
65
65
|
errorCount = 0;
|
|
66
66
|
}
|
|
67
67
|
catch (error) {
|
|
68
|
-
context.
|
|
68
|
+
context.logger.error("Invalidation scheduler failed", error);
|
|
69
69
|
if (++errorCount > 5) {
|
|
70
|
-
context.
|
|
70
|
+
context.logger.error("Too many errors, stop the scheduler");
|
|
71
71
|
break;
|
|
72
72
|
}
|
|
73
73
|
variables.currentWait = (0, async_utils_1.waitOrCancel)(1000 * 60 * 60 * 2); // next attempt in 2 hours
|
|
@@ -84,10 +84,10 @@ async function processScheduledInvalidations(context) {
|
|
|
84
84
|
return;
|
|
85
85
|
const eventKeys = events.map((e) => e.eventKey);
|
|
86
86
|
const dependencyKeys = events.flatMap((e) => e.dependencyKeys);
|
|
87
|
-
context.
|
|
87
|
+
context.logger.info(`Fire scheduled invalidation events "${eventKeys.join('", "')}", with dependencies: "${dependencyKeys.join(", ")}"`);
|
|
88
88
|
const cacheKeys = await (0, queries_1.deleteCacheValues)(context.cn, { dependencyKeys });
|
|
89
89
|
if (cacheKeys.length > 0) {
|
|
90
|
-
context.
|
|
90
|
+
context.logger.debug(`Deleted ${cacheKeys.length} invalidated cache: ${cacheKeys.join(", ")}`);
|
|
91
91
|
}
|
|
92
92
|
await (0, scheduled_invalidation_queries_1.deleteScheduledInvalidations)(context.cn, eventKeys);
|
|
93
93
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paroicms/server-text-cache-system",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.1",
|
|
4
4
|
"description": "Cache system.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"paroicms",
|
|
@@ -29,15 +29,15 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@paroi/async-lib": "~0.3.1",
|
|
31
31
|
"@paroi/data-formatters-lib": "~0.4.0",
|
|
32
|
-
"@paroicms/internal-server-lib": "1.
|
|
33
|
-
"@paroicms/internal-anywhere-lib": "1.
|
|
34
|
-
"@paroicms/public-anywhere-lib": "0.
|
|
35
|
-
"@paroicms/public-server-lib": "0.
|
|
32
|
+
"@paroicms/internal-server-lib": "1.10.1",
|
|
33
|
+
"@paroicms/internal-anywhere-lib": "1.21.0",
|
|
34
|
+
"@paroicms/public-anywhere-lib": "0.14.0",
|
|
35
|
+
"@paroicms/public-server-lib": "0.22.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@types/node": "~
|
|
38
|
+
"@types/node": "~22.10.7",
|
|
39
39
|
"rimraf": "~6.0.1",
|
|
40
|
-
"typescript": "~5.7.
|
|
40
|
+
"typescript": "~5.7.3"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"typeorm": "0.3"
|