@pgflow/edge-worker 0.0.10-prealpha.5 → 0.0.10-prealpha.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pgflow/edge-worker",
3
- "version": "0.0.10-prealpha.5",
3
+ "version": "0.0.10-prealpha.7",
4
4
  "license": "AGPL-3.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -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;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"}
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;AAEpB,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,CAAuB;;IAgB/B,UAAU,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IA4BzD,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAMhC,MAAM,IAAI,mBAAmB;IAI7B,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IA4C9B,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"}
@@ -7,6 +7,7 @@ export class DenoAdapter {
7
7
  edgeFunctionName = null;
8
8
  worker = null;
9
9
  constructor() {
10
+ console.log('DenoAdapter constructor');
10
11
  // Guard clause to ensure we're in a Deno environment
11
12
  // This is just for type checking during build
12
13
  // At runtime, this class should only be instantiated in Deno
@@ -25,6 +26,10 @@ export class DenoAdapter {
25
26
  logger.info(`HTTP Request: ${this.edgeFunctionName}`);
26
27
  // Create the worker using the factory function and the logger
27
28
  this.worker = createWorkerFn(this.createLogger.bind(this));
29
+ this.worker.startOnlyOnce({
30
+ edgeFunctionName: this.edgeFunctionName,
31
+ workerId: this.env.executionId,
32
+ });
28
33
  }
29
34
  return new Response('ok', {
30
35
  headers: { 'Content-Type': 'application/json' },
@@ -36,8 +41,7 @@ export class DenoAdapter {
36
41
  }
37
42
  async terminate() {
38
43
  if (this.worker) {
39
- this.worker.stop();
40
- this.worker = null;
44
+ await this.worker.stop();
41
45
  }
42
46
  }
43
47
  getEnv() {
@@ -45,8 +49,7 @@ export class DenoAdapter {
45
49
  }
46
50
  createLogger(module) {
47
51
  const workerId = this.env?.executionId || 'unknown';
48
- const logLevel = 'debug';
49
- // const logLevel = this.env?.logLevel || 'info';
52
+ const logLevel = this.env?.logLevel || 'info';
50
53
  // Simple level filtering
51
54
  const levels = { error: 0, warn: 1, info: 2, debug: 3 };
52
55
  const levelValue = levels[logLevel] ?? levels.info;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pgflow/edge-worker",
3
- "version": "0.0.10-prealpha.5",
3
+ "version": "0.0.10-prealpha.7",
4
4
  "license": "AGPL-3.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",