Skip to content

Commit 26e8840

Browse files
authored
Merge pull request #58 from Nya-Foundation/staging
Staging
2 parents f9c4b9a + 0779861 commit 26e8840

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

nekoconf/server/html/static/js/dashboard.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ function dashboardApp() {
185185
format: template?.format || "json",
186186
};
187187

188-
const response = await this.apiRequest("/api/apps", {
188+
const response = await this.apiRequest("api/apps", {
189189
method: "POST",
190190
body: JSON.stringify(requestBody),
191191
});
@@ -209,11 +209,11 @@ function dashboardApp() {
209209
async duplicateApp(appName) {
210210
try {
211211
// Get the original app's configuration
212-
const configResponse = await this.apiRequest(`/api/apps/${appName}/config`);
212+
const configResponse = await this.apiRequest(`api/apps/${appName}/config`);
213213
const config = await configResponse.json();
214214

215215
// Get app info for description
216-
const appResponse = await this.apiRequest(`/api/apps/${appName}`);
216+
const appResponse = await this.apiRequest(`api/apps/${appName}`);
217217
const appInfo = await appResponse.json();
218218

219219
// Generate unique name
@@ -227,7 +227,7 @@ function dashboardApp() {
227227
format: "json",
228228
};
229229

230-
await this.apiRequest("/api/apps", {
230+
await this.apiRequest("api/apps", {
231231
method: "POST",
232232
body: JSON.stringify(requestBody),
233233
});
@@ -246,7 +246,7 @@ function dashboardApp() {
246246
if (!confirmed) return;
247247

248248
try {
249-
await this.apiRequest(`/api/apps/${appName}`, {
249+
await this.apiRequest(`api/apps/${appName}`, {
250250
method: "DELETE",
251251
});
252252

@@ -297,7 +297,7 @@ function dashboardApp() {
297297
return;
298298
}
299299

300-
await this.apiRequest(`/api/apps/${this.editApp.originalName}/metadata`, {
300+
await this.apiRequest(`api/apps/${this.editApp.originalName}/metadata`, {
301301
method: "PATCH",
302302
body: JSON.stringify(requestBody),
303303
});
@@ -464,7 +464,7 @@ function dashboardApp() {
464464
const allConfigs = {};
465465

466466
for (const app of this.apps) {
467-
const response = await this.apiRequest(`/api/apps/${app.name}/config`);
467+
const response = await this.apiRequest(`api/apps/${app.name}/config`);
468468
if (response.ok) {
469469
allConfigs[app.name] = await response.json();
470470
}

nekoconf/storage/remote.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ def __init__(
2323
remote_url: str,
2424
app_name: str = "default",
2525
api_key: Optional[str] = None,
26-
reconnect_attempts: int = 20,
27-
reconnect_delay: float = 1.0,
26+
reconnect_attempts: int = 0,
27+
reconnect_delay: float = 5.0,
2828
connect_timeout: float = 5.0,
2929
**kwargs,
3030
):
@@ -240,7 +240,6 @@ def _start_websocket(self) -> None:
240240
def _websocket_thread(self) -> None:
241241
"""WebSocket connection thread function."""
242242
reconnect_count = 0
243-
current_delay = self.reconnect_delay
244243

245244
while self._running:
246245
try:
@@ -271,10 +270,9 @@ def _websocket_thread(self) -> None:
271270
break
272271

273272
self.logger.info(
274-
f"Reconnecting to app '{self.app_name}' in {current_delay:.1f}s (attempt {reconnect_count})"
273+
f"Reconnecting to app '{self.app_name}' in {self.reconnect_delay:.1f}s (attempt {reconnect_count})"
275274
)
276-
time.sleep(current_delay)
277-
current_delay = min(current_delay * 2, 60.0)
275+
time.sleep(self.reconnect_delay)
278276

279277
except Exception as e:
280278
self.logger.error(f"WebSocket error for app '{self.app_name}': {e}")

0 commit comments

Comments
 (0)