@pgflow/edge-worker 0.0.10-prealpha.3 → 0.0.10-prealpha.5
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkerLifecycle.d.ts","sourceRoot":"","sources":["../../src/core/WorkerLifecycle.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,eAAe,EAAa,MAAM,YAAY,CAAC;AAE/E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,eAAe,CAAC,QAAQ,SAAS,IAAI,CAAE,YAAW,UAAU;IACvE,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,SAAS,CAAC,CAAY;IAC9B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,KAAK,CAAkB;IAC/B,OAAO,CAAC,SAAS,CAAC,CAAY;gBAElB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM;IAO9D,gBAAgB,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"WorkerLifecycle.d.ts","sourceRoot":"","sources":["../../src/core/WorkerLifecycle.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,eAAe,EAAa,MAAM,YAAY,CAAC;AAE/E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,eAAe,CAAC,QAAQ,SAAS,IAAI,CAAE,YAAW,UAAU;IACvE,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,SAAS,CAAC,CAAY;IAC9B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,KAAK,CAAkB;IAC/B,OAAO,CAAC,SAAS,CAAC,CAAY;gBAElB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM;IAO9D,gBAAgB,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBvE,eAAe;IAyBf,IAAI,gBAAgB,uBAEnB;IAED,IAAI,SAAS,WAEZ;IAEK,aAAa;IAInB,IAAI,SAAS,YAEZ;IAED,IAAI,UAAU,YAEb;IAED,IAAI,SAAS,YAEZ;IAED,oBAAoB;CAGrB"}
|
|
@@ -15,7 +15,7 @@ export class WorkerLifecycle {
|
|
|
15
15
|
}
|
|
16
16
|
async acknowledgeStart(workerBootstrap) {
|
|
17
17
|
this.workerState.transitionTo(States.Starting);
|
|
18
|
-
|
|
18
|
+
console.log(`Ensuring queue '${this.queue.queueName}' exists...`);
|
|
19
19
|
await this.queue.safeCreate();
|
|
20
20
|
this.workerRow = await this.queries.onWorkerStarted({
|
|
21
21
|
queueName: this.queueName,
|
|
@@ -30,7 +30,7 @@ export class WorkerLifecycle {
|
|
|
30
30
|
throw new Error('Cannot stop worker: workerRow not set');
|
|
31
31
|
}
|
|
32
32
|
try {
|
|
33
|
-
|
|
33
|
+
console.log('Acknowledging worker stop...');
|
|
34
34
|
// TODO: commented out because we can live without this
|
|
35
35
|
// but it is causing problems with DbHandler - workes does not have
|
|
36
36
|
// enough time to fire this query before hard-terimnated
|
|
@@ -38,10 +38,10 @@ export class WorkerLifecycle {
|
|
|
38
38
|
//
|
|
39
39
|
// await this.queries.onWorkerStopped(this.workerRow);
|
|
40
40
|
this.workerState.transitionTo(States.Stopped);
|
|
41
|
-
|
|
41
|
+
console.log('Worker stop acknowledged');
|
|
42
42
|
}
|
|
43
43
|
catch (error) {
|
|
44
|
-
|
|
44
|
+
console.log(`Error acknowledging worker stop: ${error}`);
|
|
45
45
|
throw error;
|
|
46
46
|
}
|
|
47
47
|
}
|
package/dist/package.json
CHANGED
|
@@ -12,9 +12,6 @@ export declare class DenoAdapter implements PlatformAdapter {
|
|
|
12
12
|
terminate(): Promise<void>;
|
|
13
13
|
getEnv(): PlatformEnvironment;
|
|
14
14
|
createLogger(module: string): Logger;
|
|
15
|
-
setWorker(worker: {
|
|
16
|
-
stop(): void;
|
|
17
|
-
}): void;
|
|
18
15
|
spawnNewEdgeFunction(functionName: string): Promise<void>;
|
|
19
16
|
private detectEnvironment;
|
|
20
17
|
private extractFunctionName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DenoAdapter.d.ts","sourceRoot":"","sources":["../../src/platform/DenoAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,MAAM,EACN,eAAe,EACf,mBAAmB,EACpB,MAAM,YAAY,CAAC;AACpB,OAAO,iBAAiB,CAAC;AAEzB;;GAEG;AACH,qBAAa,WAAY,YAAW,eAAe;IACjD,OAAO,CAAC,GAAG,CAAsB;IACjC,OAAO,CAAC,gBAAgB,CAAuB;IAC/C,OAAO,CAAC,MAAM,CAAiC;;IAezC,UAAU,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBzD,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAOhC,MAAM,IAAI,mBAAmB;IAI7B,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"DenoAdapter.d.ts","sourceRoot":"","sources":["../../src/platform/DenoAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,MAAM,EACN,eAAe,EACf,mBAAmB,EACpB,MAAM,YAAY,CAAC;AACpB,OAAO,iBAAiB,CAAC;AAEzB;;GAEG;AACH,qBAAa,WAAY,YAAW,eAAe;IACjD,OAAO,CAAC,GAAG,CAAsB;IACjC,OAAO,CAAC,gBAAgB,CAAuB;IAC/C,OAAO,CAAC,MAAM,CAAiC;;IAezC,UAAU,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBzD,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAOhC,MAAM,IAAI,mBAAmB;IAI7B,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IA6C9B,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA+B/D,OAAO,CAAC,iBAAiB;IAsBzB,OAAO,CAAC,mBAAmB;IAI3B,oBAAoB,IAAI,IAAI;CAW7B"}
|
|
@@ -45,7 +45,8 @@ export class DenoAdapter {
|
|
|
45
45
|
}
|
|
46
46
|
createLogger(module) {
|
|
47
47
|
const workerId = this.env?.executionId || 'unknown';
|
|
48
|
-
const logLevel =
|
|
48
|
+
const logLevel = 'debug';
|
|
49
|
+
// const logLevel = this.env?.logLevel || 'info';
|
|
49
50
|
// Simple level filtering
|
|
50
51
|
const levels = { error: 0, warn: 1, info: 2, debug: 3 };
|
|
51
52
|
const levelValue = levels[logLevel] ?? levels.info;
|
|
@@ -72,9 +73,6 @@ export class DenoAdapter {
|
|
|
72
73
|
},
|
|
73
74
|
};
|
|
74
75
|
}
|
|
75
|
-
setWorker(worker) {
|
|
76
|
-
this.worker = worker;
|
|
77
|
-
}
|
|
78
76
|
async spawnNewEdgeFunction(functionName) {
|
|
79
77
|
if (!functionName) {
|
|
80
78
|
throw new Error('functionName cannot be null or empty');
|
|
@@ -121,8 +119,7 @@ export class DenoAdapter {
|
|
|
121
119
|
await this.spawnNewEdgeFunction(this.edgeFunctionName);
|
|
122
120
|
}
|
|
123
121
|
if (this.worker) {
|
|
124
|
-
this.worker.stop();
|
|
125
|
-
this.worker = null;
|
|
122
|
+
await this.worker.stop();
|
|
126
123
|
}
|
|
127
124
|
};
|
|
128
125
|
}
|