@k-system/tickr-mcp 1.7.0 → 1.8.0
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/api-client.js +6 -1
- package/package.json +1 -1
package/dist/api-client.js
CHANGED
|
@@ -20,7 +20,7 @@ export class ApiClient {
|
|
|
20
20
|
async delete(path) {
|
|
21
21
|
return this.request("DELETE", path);
|
|
22
22
|
}
|
|
23
|
-
async request(method, path, body) {
|
|
23
|
+
async request(method, path, body, retryCount = 0) {
|
|
24
24
|
const auth = await getAuthHeader(this.config);
|
|
25
25
|
const url = `${this.config.apiUrl}${path}`;
|
|
26
26
|
const headers = {
|
|
@@ -35,6 +35,11 @@ export class ApiClient {
|
|
|
35
35
|
headers,
|
|
36
36
|
body: body !== undefined ? JSON.stringify(body) : undefined,
|
|
37
37
|
});
|
|
38
|
+
// Auto-retry na 409 Conflict (optimistic locking) — max 3 pokusy
|
|
39
|
+
if (res.status === 409 && retryCount < 3) {
|
|
40
|
+
await new Promise((r) => setTimeout(r, 200 * (retryCount + 1)));
|
|
41
|
+
return this.request(method, path, body, retryCount + 1);
|
|
42
|
+
}
|
|
38
43
|
if (!res.ok) {
|
|
39
44
|
// Pokus o parsování unified error response
|
|
40
45
|
const text = await res.text().catch(() => "");
|