@hatchet-dev/typescript-sdk 0.15.0 → 0.15.1-alpha1

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.
@@ -79,6 +79,7 @@ class GrpcPooledListener {
79
79
  }
80
80
  try {
81
81
  this.client.logger.debug('Initializing child-listener');
82
+ this.signal = new AbortController();
82
83
  this.listener = this.client.client.subscribeToWorkflowRuns(this.request(), {
83
84
  signal: this.signal.signal,
84
85
  });
@@ -111,6 +112,7 @@ class GrpcPooledListener {
111
112
  }
112
113
  finally { if (e_1) throw e_1.error; }
113
114
  }
115
+ this.client.logger.debug('Child listener finished');
114
116
  }
115
117
  catch (e) {
116
118
  if ((0, abort_controller_x_1.isAbortError)(e)) {
@@ -118,7 +120,14 @@ class GrpcPooledListener {
118
120
  return;
119
121
  }
120
122
  this.client.logger.error(`Error in child-listener: ${e.message}`);
121
- this.init(retries + 1);
123
+ }
124
+ finally {
125
+ // it is possible the server hangs up early,
126
+ // restart the listener if we still have subscribers
127
+ this.client.logger.debug('Child listener finally');
128
+ if (Object.keys(this.subscribers).length !== 0) {
129
+ this.init(retries + 1);
130
+ }
122
131
  }
123
132
  });
124
133
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hatchet-dev/typescript-sdk",
3
- "version": "0.15.0",
3
+ "version": "0.15.1-alpha1",
4
4
  "description": "Background task orchestration & visibility for developers",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -58,6 +58,7 @@
58
58
  "api": "npm run exec -- ./src/examples/api.ts",
59
59
  "prepublish": "cp package.json dist/package.json;",
60
60
  "publish:ci": "rm -rf ./dist && npm run tsc:build && npm run prepublish && cd dist && npm publish --access public --no-git-checks",
61
+ "publish:ci:alpha": "rm -rf ./dist && npm run tsc:build && npm run prepublish && cd dist && npm publish --access public --no-git-checks --tag alpha",
61
62
  "generate-docs": "typedoc"
62
63
  },
63
64
  "keywords": [],