From d7e7d248cbe41cd7a9ef9c2fb022b6c4831f99a3 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sun, 31 May 2026 15:22:56 +0000
Subject: [PATCH] =jakevan complete
---
assets/js/concise/Queue.js | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/assets/js/concise/Queue.js b/assets/js/concise/Queue.js
index a2232ca..1122684 100644
--- a/assets/js/concise/Queue.js
+++ b/assets/js/concise/Queue.js
@@ -17,6 +17,7 @@
this.items = new Map();
this.subscribers = new Set();
this.loadFromStorage = false;
+ this.failedFetches = 0;
this.api = jvbSettings.api;
this.endpoint = 'queue';
@@ -626,7 +627,7 @@
if (result.id && operation.id !== result.id) {
operation = await this.handleServerMerge(operation, result);
} else {
- operation.status = result.status??'failed';
+ operation.status = result.status??'pending';
operation.serverData = result;
this.updateOperationStatus(operation.id, operation.status);
}
@@ -786,7 +787,14 @@
try {
this.ui.refresh.button.classList.add('fetching');
this.store.clearCache();
- await this.store.fetch();
+ let response = await this.store.fetch();
+ if (response.status === 429) {
+ console.log('Too many requests. Waiting 30 seconds');
+ this.stopPolling();
+ this.startCountdown(30, () => this.runPollCycle());
+ return;
+ }
+
this.ui.refresh.button.classList.remove('fetching');
if (!this.maybeStartPolling()) {
this.stopPolling();
@@ -794,6 +802,8 @@
return;
}
} catch (error) {
+ this.stopPolling();
+ this.updatePanel('synced');
console.error('Polling error:', error);
}
--
Gitblit v1.10.0