apify-client 3.0.0-beta.84 → 3.0.0-beta.86
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/base/resource_client.js +8 -8
- package/dist/bundle.js +2 -2
- package/dist/bundle.js.map +1 -1
- package/dist/generated/api.d.ts +7 -7
- package/dist/resource_clients/dataset.d.ts +2 -1
- package/dist/resource_clients/dataset.js +3 -2
- package/dist/resource_clients/key_value_store.d.ts +2 -1
- package/dist/resource_clients/key_value_store.js +3 -2
- package/package.json +1 -1
|
@@ -102,7 +102,7 @@ export class ResourceClient extends ApiClient {
|
|
|
102
102
|
const hasJobEnded = job && ACT_JOB_TERMINAL_STATUSES.includes(job.status);
|
|
103
103
|
return !hasJobEnded;
|
|
104
104
|
};
|
|
105
|
-
|
|
105
|
+
while (true) {
|
|
106
106
|
const millisSinceStart = Date.now() - startedAt;
|
|
107
107
|
const remainingWaitSeconds = Math.round((waitMillis - millisSinceStart) / 1000);
|
|
108
108
|
const waitForFinish = Math.max(0, remainingWaitSeconds);
|
|
@@ -124,13 +124,13 @@ export class ResourceClient extends ApiClient {
|
|
|
124
124
|
notFoundSince ??= Date.now();
|
|
125
125
|
notFoundError = err;
|
|
126
126
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
127
|
+
if (!shouldRepeat())
|
|
128
|
+
break;
|
|
129
|
+
// The API answers right away when the remaining wait rounds to 0 seconds, and database replicas may not see
|
|
130
|
+
// a new job for a short while, so pause before the next poll.
|
|
131
|
+
await sleep(250, signal);
|
|
132
|
+
signal?.throwIfAborted();
|
|
133
|
+
}
|
|
134
134
|
if (!job)
|
|
135
135
|
throw notFoundError;
|
|
136
136
|
return job;
|