@prisma/compute 0.1.0-dev.13.1 → 0.1.0-dev.131.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/scale-to-zero-control.js +11 -10
- package/package.json +3 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
let controlFileState = {
|
|
3
3
|
kind: "uninitialized",
|
|
4
|
-
|
|
4
|
+
paths: ["/run/prisma/compute/keep-awake", "/uk/libukp/scale_to_zero_disable"]
|
|
5
5
|
};
|
|
6
6
|
function writeScaleToZeroSignal(signal) {
|
|
7
7
|
const state = getControlFileState();
|
|
@@ -15,18 +15,19 @@ function writeScaleToZeroSignal(signal) {
|
|
|
15
15
|
}
|
|
16
16
|
function getControlFileState() {
|
|
17
17
|
if (controlFileState.kind !== "uninitialized") return controlFileState;
|
|
18
|
-
|
|
18
|
+
const paths = controlFileState.paths;
|
|
19
|
+
for (const path of paths) try {
|
|
19
20
|
controlFileState = {
|
|
20
21
|
kind: "open",
|
|
21
|
-
fd: fs.openSync(
|
|
22
|
-
path
|
|
22
|
+
fd: fs.openSync(path, fs.constants.O_WRONLY),
|
|
23
|
+
path
|
|
23
24
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
25
|
+
return controlFileState;
|
|
26
|
+
} catch {}
|
|
27
|
+
controlFileState = {
|
|
28
|
+
kind: "unavailable",
|
|
29
|
+
paths
|
|
30
|
+
};
|
|
30
31
|
return controlFileState;
|
|
31
32
|
}
|
|
32
33
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/compute",
|
|
3
|
-
"version": "0.1.0-dev.
|
|
3
|
+
"version": "0.1.0-dev.131.1",
|
|
4
4
|
"description": "Utilities for applications running on the Prisma compute runtime.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -38,9 +38,11 @@
|
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "tsdown",
|
|
40
40
|
"prepack": "pnpm run build",
|
|
41
|
+
"typecheck": "tsc --noEmit",
|
|
41
42
|
"test": "vitest run"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
45
|
+
"@repo/tsconfig": "workspace:8.0.0-rc.13",
|
|
44
46
|
"@types/node": "^22.19.19",
|
|
45
47
|
"tsdown": "^0.21.10",
|
|
46
48
|
"typescript": "^6.0.3",
|