@paroicms/server-image-cache-engine 1.4.0 → 1.5.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.
|
@@ -2,7 +2,7 @@ import type { AppLog } from "@paroicms/server-lib";
|
|
|
2
2
|
export declare let sharpQueue: <T extends () => Promise<any>>(task: T) => ReturnType<T>;
|
|
3
3
|
export interface SetupImageProcessorOptions {
|
|
4
4
|
cpuCoresPerFile?: number;
|
|
5
|
-
|
|
5
|
+
allowConcurrency?: boolean;
|
|
6
6
|
appLog: AppLog;
|
|
7
7
|
}
|
|
8
|
-
export declare function setupImageProcessor({ cpuCoresPerFile,
|
|
8
|
+
export declare function setupImageProcessor({ cpuCoresPerFile, allowConcurrency, appLog, }: SetupImageProcessorOptions): void;
|
|
@@ -7,14 +7,17 @@ exports.setupImageProcessor = exports.sharpQueue = void 0;
|
|
|
7
7
|
const async_lib_1 = require("@paroi/async-lib");
|
|
8
8
|
const sharp_1 = __importDefault(require("sharp"));
|
|
9
9
|
exports.sharpQueue = execImmediately;
|
|
10
|
-
function setupImageProcessor({ cpuCoresPerFile,
|
|
10
|
+
function setupImageProcessor({ cpuCoresPerFile, allowConcurrency, appLog, }) {
|
|
11
|
+
const oldValue = sharp_1.default.concurrency();
|
|
11
12
|
if (cpuCoresPerFile !== undefined) {
|
|
12
|
-
const oldValue = sharp_1.default.concurrency();
|
|
13
13
|
// https://sharp.pixelplumbing.com/api-utility#concurrency
|
|
14
14
|
sharp_1.default.concurrency(cpuCoresPerFile);
|
|
15
15
|
appLog.info(`Set sharp concurrency (cpu cores per file) to '${cpuCoresPerFile}' (was ${oldValue})`);
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
else {
|
|
18
|
+
appLog.info(`Use the sharp concurrency (cpu cores per file) default value: ${oldValue}`);
|
|
19
|
+
}
|
|
20
|
+
if (!allowConcurrency) {
|
|
18
21
|
exports.sharpQueue = (0, async_lib_1.createAsyncQueue)({
|
|
19
22
|
delayMs: 50,
|
|
20
23
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-processor-setup.js","sourceRoot":"","sources":["../src/image-processor-setup.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAoD;AAEpD,kDAA0B;AAEf,QAAA,UAAU,GAA6D,eAAe,CAAC;AAQlG,SAAgB,mBAAmB,CAAC,EAClC,eAAe,EACf,
|
|
1
|
+
{"version":3,"file":"image-processor-setup.js","sourceRoot":"","sources":["../src/image-processor-setup.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAoD;AAEpD,kDAA0B;AAEf,QAAA,UAAU,GAA6D,eAAe,CAAC;AAQlG,SAAgB,mBAAmB,CAAC,EAClC,eAAe,EACf,gBAAgB,EAChB,MAAM,GACqB;IAC3B,MAAM,QAAQ,GAAG,eAAK,CAAC,WAAW,EAAE,CAAC;IACrC,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;QAClC,0DAA0D;QAC1D,eAAK,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;QACnC,MAAM,CAAC,IAAI,CACT,kDAAkD,eAAe,UAAU,QAAQ,GAAG,CACvF,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,IAAI,CAAC,iEAAiE,QAAQ,EAAE,CAAC,CAAC;IAC3F,CAAC;IACD,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,kBAAU,GAAG,IAAA,4BAAgB,EAAC;YAC5B,OAAO,EAAE,EAAE;SACZ,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;IACvD,CAAC;AACH,CAAC;AArBD,kDAqBC;AAED,SAAS,eAAe,CAA+B,IAAO;IAC5D,OAAO,IAAI,EAAmB,CAAC;AACjC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paroicms/server-image-cache-engine",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "The image variant engine that we use at Paroi.",
|
|
5
5
|
"author": "Paroi Team",
|
|
6
6
|
"main": "dist/api.js",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@paroi/async-lib": "~0.2.0",
|
|
38
38
|
"@paroi/data-formatters-lib": "~0.3.0",
|
|
39
|
-
"@paroicms/anywhere-lib": "1.
|
|
40
|
-
"@paroicms/server-lib": "1.
|
|
39
|
+
"@paroicms/anywhere-lib": "1.8.0",
|
|
40
|
+
"@paroicms/server-lib": "1.4.1",
|
|
41
41
|
"ico-endec": "~0.1.6",
|
|
42
42
|
"sharp": "~0.33.3"
|
|
43
43
|
},
|