@workglow/ai 0.2.26 → 0.2.27

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/bun.js CHANGED
@@ -418,18 +418,16 @@ class QueuedExecutionStrategy {
418
418
  }
419
419
  }
420
420
  async acquireLimiterSlot(limiter, signal) {
421
- const poll = async () => {
422
- while (!await limiter.canProceed()) {
423
- if (signal.aborted) {
424
- throw signal.reason ?? new AbortSignalJobError2("The operation was aborted");
425
- }
426
- const next = await limiter.getNextAvailableTime();
427
- const delay = Math.max(0, next.getTime() - Date.now());
428
- await new Promise((resolve) => setTimeout(resolve, Math.min(delay, 50)));
421
+ let token = await limiter.tryAcquire();
422
+ while (token === null || token === undefined) {
423
+ if (signal.aborted) {
424
+ throw signal.reason ?? new AbortSignalJobError2("The operation was aborted");
429
425
  }
430
- };
431
- await poll();
432
- await limiter.recordJobStart();
426
+ const next = await limiter.getNextAvailableTime();
427
+ const delay = Math.max(0, next.getTime() - Date.now());
428
+ await new Promise((resolve) => setTimeout(resolve, Math.min(delay, 50)));
429
+ token = await limiter.tryAcquire();
430
+ }
433
431
  }
434
432
  ensureQueue() {
435
433
  if (!this.initPromise) {
@@ -7447,4 +7445,4 @@ export {
7447
7445
  AiChatInputSchema
7448
7446
  };
7449
7447
 
7450
- //# debugId=9A35FF50116833CB64756E2164756E21
7448
+ //# debugId=86E44CAF5F4795D864756E2164756E21