@nosana/node 1.1.59 → 1.1.60-rc

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": "@nosana/node",
3
- "version": "1.1.59",
3
+ "version": "1.1.60-rc",
4
4
  "description": "",
5
5
  "bin": {
6
6
  "nosana-node": "./dist/src/index.js"
@@ -1,7 +1,14 @@
1
+ // Neither the timeout nor a rejected promise can confirm how the wrapped work
2
+ // ended, so both abort as a failure. 'quit' is StopReasons.QUIT, spelled out
3
+ // here to keep this utility off TaskManager's import graph.
4
+ const ABORT_REASON = 'quit';
1
5
  export function promiseTimeoutWrapper(promise, expiry_time, abortController) {
2
6
  const timeoutError = new Error('Promise took too long to settle, expiry timeout met.');
7
+ // The caller's controller is an operation's own, and its abort reason is read
8
+ // back as a StopReason. A bare abort() would set the reason to a DOMException,
9
+ // which resolves to no status at all.
3
10
  const timer = setTimeout(() => {
4
- abortController.abort();
11
+ abortController.abort(ABORT_REASON);
5
12
  }, expiry_time * 1000);
6
13
  if (abortController.signal.aborted) {
7
14
  return Promise.reject(timeoutError);
@@ -19,7 +26,7 @@ export function promiseTimeoutWrapper(promise, expiry_time, abortController) {
19
26
  promise
20
27
  .then((value) => resolve(value))
21
28
  .catch((error) => {
22
- abortController.abort();
29
+ abortController.abort(ABORT_REASON);
23
30
  reject(error);
24
31
  })
25
32
  .finally(onSettled);
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@nosana/node",
3
- "version": "1.1.59",
3
+ "version": "1.1.60-rc",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@nosana/node",
9
- "version": "1.1.59",
9
+ "version": "1.1.60-rc",
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
12
  "@coral-xyz/anchor": "^0.28.1-beta.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nosana/node",
3
- "version": "1.1.59",
3
+ "version": "1.1.60-rc",
4
4
  "description": "",
5
5
  "bin": {
6
6
  "nosana-node": "./dist/src/index.js"