@openfn/ws-worker 1.15.0 → 1.15.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # ws-worker
2
2
 
3
+ ## 1.15.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [362d6bf]
8
+ - @openfn/engine-multi@1.6.12
9
+
10
+ ## 1.15.1
11
+
12
+ ### Patch Changes
13
+
14
+ - 569f405: Improve compiler logging output
15
+ - @openfn/engine-multi@1.6.11
16
+
3
17
  ## 1.15.0
4
18
 
5
19
  Move expression compilation down into the run thread, isolating its memory from the main worker thread. This should work around a memory leak in long-running workers and improve the robustness of the worker generally.
package/dist/index.js CHANGED
@@ -777,17 +777,22 @@ async function onStepStart(context, event) {
777
777
  import { timestamp as timestamp3 } from "@openfn/logger";
778
778
  var log_final_reason_default = async (context, reason) => {
779
779
  const time = (timestamp3() - BigInt(1e7)).toString();
780
- let message = `Run complete with status: ${reason.reason}`;
781
- if (reason.reason !== "success") {
782
- message += `
783
- ${reason.error_type}: ${reason.error_message || "unknown"}`;
784
- }
780
+ const statusMessage = `Run complete with status: ${reason.reason}`;
785
781
  await onJobLog(context, {
786
782
  time,
787
- message: [message],
783
+ message: [statusMessage],
788
784
  level: "info",
789
785
  name: "R/T"
790
786
  });
787
+ if (reason.reason !== "success") {
788
+ const errorMessage = `${reason.error_type}: ${reason.error_message || "unknown"}`;
789
+ await onJobLog(context, {
790
+ time,
791
+ message: [errorMessage],
792
+ level: "info",
793
+ name: "R/T"
794
+ });
795
+ }
791
796
  };
792
797
 
793
798
  // src/events/run-complete.ts
@@ -933,6 +938,7 @@ function execute(channel, engine, logger, plan, input, options = {}, onFinish =
933
938
  });
934
939
  engine.execute(plan, loadedInput, { resolvers, ...options });
935
940
  } catch (e) {
941
+ process.exit(66);
936
942
  Sentry3.addBreadcrumb({
937
943
  category: "run",
938
944
  message: "exception in run",
package/dist/start.js CHANGED
@@ -917,17 +917,22 @@ async function onStepStart(context, event) {
917
917
  import { timestamp as timestamp3 } from "@openfn/logger";
918
918
  var log_final_reason_default = async (context, reason) => {
919
919
  const time = (timestamp3() - BigInt(1e7)).toString();
920
- let message = `Run complete with status: ${reason.reason}`;
921
- if (reason.reason !== "success") {
922
- message += `
923
- ${reason.error_type}: ${reason.error_message || "unknown"}`;
924
- }
920
+ const statusMessage = `Run complete with status: ${reason.reason}`;
925
921
  await onJobLog(context, {
926
922
  time,
927
- message: [message],
923
+ message: [statusMessage],
928
924
  level: "info",
929
925
  name: "R/T"
930
926
  });
927
+ if (reason.reason !== "success") {
928
+ const errorMessage = `${reason.error_type}: ${reason.error_message || "unknown"}`;
929
+ await onJobLog(context, {
930
+ time,
931
+ message: [errorMessage],
932
+ level: "info",
933
+ name: "R/T"
934
+ });
935
+ }
931
936
  };
932
937
 
933
938
  // src/events/run-complete.ts
@@ -1073,6 +1078,7 @@ function execute(channel, engine, logger2, plan, input, options = {}, onFinish =
1073
1078
  });
1074
1079
  engine.execute(plan, loadedInput, { resolvers, ...options });
1075
1080
  } catch (e) {
1081
+ process.exit(66);
1076
1082
  Sentry3.addBreadcrumb({
1077
1083
  category: "run",
1078
1084
  message: "exception in run",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfn/ws-worker",
3
- "version": "1.15.0",
3
+ "version": "1.15.2",
4
4
  "description": "A Websocket Worker to connect Lightning to a Runtime Engine",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -23,9 +23,9 @@
23
23
  "koa-logger": "^3.2.1",
24
24
  "phoenix": "1.7.10",
25
25
  "ws": "^8.18.3",
26
- "@openfn/engine-multi": "1.6.10",
27
- "@openfn/lexicon": "^1.2.3",
26
+ "@openfn/engine-multi": "1.6.12",
28
27
  "@openfn/logger": "1.0.6",
28
+ "@openfn/lexicon": "^1.2.3",
29
29
  "@openfn/runtime": "1.7.2"
30
30
  },
31
31
  "devDependencies": {
@@ -43,7 +43,7 @@
43
43
  "tsup": "^6.7.0",
44
44
  "typescript": "^4.9.5",
45
45
  "yargs": "^17.7.2",
46
- "@openfn/lightning-mock": "2.2.5"
46
+ "@openfn/lightning-mock": "2.2.7"
47
47
  },
48
48
  "files": [
49
49
  "dist",