@golpoai/sdk 0.1.2 → 0.1.3
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.cjs +6 -2
- package/dist/index.js +6 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -147,8 +147,12 @@ var Golpo = class {
|
|
|
147
147
|
* ------------------------------------------------------------ */
|
|
148
148
|
async poll(jobId, interval) {
|
|
149
149
|
while (true) {
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
try {
|
|
151
|
+
const { data } = await this.http.get(`/status/${jobId}`);
|
|
152
|
+
if (data.status === "completed") return data;
|
|
153
|
+
} catch (error) {
|
|
154
|
+
console.warn(`Status check failed for job ${jobId}, retrying in ${interval}ms:`, error instanceof Error ? error.message : error);
|
|
155
|
+
}
|
|
152
156
|
await new Promise((r) => setTimeout(r, interval));
|
|
153
157
|
}
|
|
154
158
|
}
|
package/dist/index.js
CHANGED
|
@@ -110,8 +110,12 @@ var Golpo = class {
|
|
|
110
110
|
* ------------------------------------------------------------ */
|
|
111
111
|
async poll(jobId, interval) {
|
|
112
112
|
while (true) {
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
try {
|
|
114
|
+
const { data } = await this.http.get(`/status/${jobId}`);
|
|
115
|
+
if (data.status === "completed") return data;
|
|
116
|
+
} catch (error) {
|
|
117
|
+
console.warn(`Status check failed for job ${jobId}, retrying in ${interval}ms:`, error instanceof Error ? error.message : error);
|
|
118
|
+
}
|
|
115
119
|
await new Promise((r) => setTimeout(r, interval));
|
|
116
120
|
}
|
|
117
121
|
}
|