@iworkflow/dbos 0.6.0 → 0.6.1

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/index.js CHANGED
@@ -127,7 +127,6 @@ class Semaphore {
127
127
  class AttemptTimeout extends Error {
128
128
  }
129
129
  var sleepMs = (ms) => new Promise((r) => setTimeout(r, ms));
130
- var scope = stepScope(alsScope);
131
130
  async function withTimeout(p, ms) {
132
131
  let timer;
133
132
  try {
@@ -145,7 +144,7 @@ async function attempts(fn, args, opts, pool, alive, priority, runtime) {
145
144
  let interval = opts.retryIntervalMs ?? 200;
146
145
  for (let n = 1;; n++) {
147
146
  try {
148
- const attempt = () => scope.run(runtime(n), () => withTimeout(fn(...args), opts.timeoutMs ?? 60000));
147
+ const attempt = () => stepScope(alsScope).run(runtime(n), () => withTimeout(fn(...args), opts.timeoutMs ?? 60000));
149
148
  return await (pool ? pool.run(attempt, priority) : attempt());
150
149
  } catch (e) {
151
150
  const stop = e instanceof Failure && e.nonRetryable || (opts.nonRetryableTypes ?? []).includes(typeOf(e));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iworkflow/dbos",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "DBOS adapter for @iworkflow/core",
5
5
  "keywords": [
6
6
  "workflow",
@@ -37,7 +37,7 @@
37
37
  "prepack": "bun run build"
38
38
  },
39
39
  "dependencies": {
40
- "@iworkflow/core": "^0.6.0",
40
+ "@iworkflow/core": "^0.6.1",
41
41
  "pg": "^8.0.0"
42
42
  },
43
43
  "peerDependencies": {
package/src/index.ts CHANGED
@@ -166,7 +166,7 @@ class AttemptTimeout extends Error {}
166
166
 
167
167
  const sleepMs = (ms: number) => new Promise((r) => setTimeout(r, ms));
168
168
 
169
- const scope = stepScope(alsScope);
169
+
170
170
 
171
171
  /** Попытка, урезанная по сроку: брошенная продолжает идти в фоне, её итог отбрасывается. */
172
172
  async function withTimeout<T>(p: Promise<T>, ms: number): Promise<T> {
@@ -196,7 +196,7 @@ async function attempts(
196
196
  let interval = opts.retryIntervalMs ?? 200;
197
197
  for (let n = 1; ; n++) {
198
198
  try {
199
- const attempt = () => scope.run(runtime(n), () => withTimeout(fn(...args), opts.timeoutMs ?? 60_000));
199
+ const attempt = () => stepScope(alsScope).run(runtime(n), () => withTimeout(fn(...args), opts.timeoutMs ?? 60_000));
200
200
  return await (pool ? pool.run(attempt, priority) : attempt());
201
201
  } catch (e) {
202
202
  const stop = (e instanceof Failure && e.nonRetryable) || (opts.nonRetryableTypes ?? []).includes(typeOf(e));