renovate 44.112.0 → 44.112.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.
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { GlobalConfig } from "../../../config/global.js";
|
|
2
2
|
import { logger } from "../../../logger/index.js";
|
|
3
3
|
import { HttpCache } from "../../http/cache/schema.js";
|
|
4
|
+
import { isTruthy } from "@sindresorhus/is";
|
|
4
5
|
import { DateTime } from "luxon";
|
|
5
6
|
//#region lib/util/cache/repository/http-cache.ts
|
|
6
7
|
function cleanupHttpCache(cacheData) {
|
|
7
|
-
|
|
8
|
-
if (!httpCache) {
|
|
8
|
+
if (!cacheData.httpCache && !cacheData.httpCacheHead) {
|
|
9
9
|
logger.trace("cleanupHttpCache: no http cache to clean up");
|
|
10
10
|
return;
|
|
11
11
|
}
|
|
@@ -13,10 +13,16 @@ function cleanupHttpCache(cacheData) {
|
|
|
13
13
|
if (ttlDays === 0) {
|
|
14
14
|
logger.trace("cleanupHttpCache: zero value received, removing the cache");
|
|
15
15
|
delete cacheData.httpCache;
|
|
16
|
+
delete cacheData.httpCacheHead;
|
|
16
17
|
return;
|
|
17
18
|
}
|
|
18
19
|
const now = DateTime.now();
|
|
19
|
-
|
|
20
|
+
const entries = [cacheData.httpCache, cacheData.httpCacheHead].filter(isTruthy).flatMap((httpCache) => Object.entries(httpCache).map(([url, item]) => ({
|
|
21
|
+
httpCache,
|
|
22
|
+
url,
|
|
23
|
+
item
|
|
24
|
+
})));
|
|
25
|
+
for (const { httpCache, url, item } of entries) {
|
|
20
26
|
const parsed = HttpCache.safeParse(item);
|
|
21
27
|
if (!parsed.success || !parsed.data) {
|
|
22
28
|
logger.debug(`http cache: removing invalid cache for ${url}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-cache.js","names":[],"sources":["../../../../lib/util/cache/repository/http-cache.ts"],"sourcesContent":["import { DateTime } from 'luxon';\nimport { GlobalConfig } from '../../../config/global.ts';\nimport { logger } from '../../../logger/index.ts';\nimport { HttpCache } from '../../http/cache/schema.ts';\nimport type { RepoCacheData } from './types.ts';\n\nexport function cleanupHttpCache(cacheData: RepoCacheData): void {\n
|
|
1
|
+
{"version":3,"file":"http-cache.js","names":[],"sources":["../../../../lib/util/cache/repository/http-cache.ts"],"sourcesContent":["import { isTruthy } from '@sindresorhus/is';\nimport { DateTime } from 'luxon';\nimport { GlobalConfig } from '../../../config/global.ts';\nimport { logger } from '../../../logger/index.ts';\nimport { HttpCache } from '../../http/cache/schema.ts';\nimport type { RepoCacheData } from './types.ts';\n\nexport function cleanupHttpCache(cacheData: RepoCacheData): void {\n if (!cacheData.httpCache && !cacheData.httpCacheHead) {\n logger.trace('cleanupHttpCache: no http cache to clean up');\n return;\n }\n\n const ttlDays = GlobalConfig.get('httpCacheTtlDays');\n if (ttlDays === 0) {\n logger.trace('cleanupHttpCache: zero value received, removing the cache');\n delete cacheData.httpCache;\n delete cacheData.httpCacheHead;\n return;\n }\n\n const now = DateTime.now();\n const entries = [cacheData.httpCache, cacheData.httpCacheHead]\n .filter(isTruthy)\n .flatMap((httpCache) =>\n Object.entries(httpCache).map(([url, item]) => ({\n httpCache,\n url,\n item,\n })),\n );\n for (const { httpCache, url, item } of entries) {\n const parsed = HttpCache.safeParse(item);\n if (!parsed.success || !parsed.data) {\n logger.debug(`http cache: removing invalid cache for ${url}`);\n delete httpCache[url];\n continue;\n }\n const expiry = DateTime.fromISO(parsed.data.timestamp).plus({\n days: ttlDays,\n });\n if (expiry < now) {\n logger.debug(`http cache: removing expired cache for ${url}`);\n delete httpCache[url];\n }\n }\n}\n"],"mappings":";;;;;;AAOA,SAAgB,iBAAiB,WAAgC;CAC/D,IAAI,CAAC,UAAU,aAAa,CAAC,UAAU,eAAe;EACpD,OAAO,MAAM,6CAA6C;EAC1D;CACF;CAEA,MAAM,UAAU,aAAa,IAAI,kBAAkB;CACnD,IAAI,YAAY,GAAG;EACjB,OAAO,MAAM,2DAA2D;EACxE,OAAO,UAAU;EACjB,OAAO,UAAU;EACjB;CACF;CAEA,MAAM,MAAM,SAAS,IAAI;CACzB,MAAM,UAAU,CAAC,UAAU,WAAW,UAAU,aAAa,CAAC,CAC3D,OAAO,QAAQ,CAAC,CAChB,SAAS,cACR,OAAO,QAAQ,SAAS,CAAC,CAAC,KAAK,CAAC,KAAK,WAAW;EAC9C;EACA;EACA;CACF,EAAE,CACJ;CACF,KAAK,MAAM,EAAE,WAAW,KAAK,UAAU,SAAS;EAC9C,MAAM,SAAS,UAAU,UAAU,IAAI;EACvC,IAAI,CAAC,OAAO,WAAW,CAAC,OAAO,MAAM;GACnC,OAAO,MAAM,0CAA0C,KAAK;GAC5D,OAAO,UAAU;GACjB;EACF;EAIA,IAHe,SAAS,QAAQ,OAAO,KAAK,SAAS,CAAC,CAAC,KAAK,EAC1D,MAAM,QACR,CACS,IAAI,KAAK;GAChB,OAAO,MAAM,0CAA0C,KAAK;GAC5D,OAAO,UAAU;EACnB;CACF;AACF"}
|
package/package.json
CHANGED
package/renovate-schema.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$id": "https://docs.renovatebot.com/renovate-schema.json",
|
|
3
|
-
"title": "JSON schema for Renovate 44.112.
|
|
3
|
+
"title": "JSON schema for Renovate 44.112.1 config files (https://renovatebot.com/)",
|
|
4
4
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5
|
-
"x-renovate-version": "44.112.
|
|
5
|
+
"x-renovate-version": "44.112.1",
|
|
6
6
|
"allowComments": true,
|
|
7
7
|
"type": "object",
|
|
8
8
|
"definitions": {
|