mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-16 19:33:11 +02:00
Desktop Self-hosted guidance improvements (#5060)
Removed timeout when waiting for backend port to allow for slow backend spinups <img width="1185" height="951" alt="image" src="https://github.com/user-attachments/assets/badaf8e5-611d-44aa-aca2-7c1c906c2019" /> <img width="1213" height="1533" alt="image" src="https://github.com/user-attachments/assets/ce78b67a-07e0-4c23-9087-5de0c5f203c6" /> <img width="1207" height="1202" alt="image" src="https://github.com/user-attachments/assets/c6e5b4c5-9cc3-4973-a634-3b7aa1e1dd34" />
This commit is contained in:
@@ -101,8 +101,8 @@ export class TauriBackendService {
|
||||
return this.startPromise;
|
||||
}
|
||||
|
||||
private async waitForPort(maxAttempts = 30): Promise<void> {
|
||||
for (let i = 0; i < maxAttempts; i++) {
|
||||
private async waitForPort(): Promise<void> {
|
||||
while (true) {
|
||||
try {
|
||||
const port = await invoke<number | null>('get_backend_port');
|
||||
if (port) {
|
||||
@@ -114,7 +114,6 @@ export class TauriBackendService {
|
||||
}
|
||||
await new Promise(resolve => setTimeout(resolve, 500));
|
||||
}
|
||||
throw new Error('Failed to detect backend port after 15 seconds');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -208,16 +207,14 @@ export class TauriBackendService {
|
||||
}
|
||||
}
|
||||
|
||||
private async waitForHealthy(maxAttempts = 60): Promise<void> {
|
||||
for (let i = 0; i < maxAttempts; i++) {
|
||||
private async waitForHealthy(): Promise<void> {
|
||||
while (true) {
|
||||
const isHealthy = await this.checkBackendHealth();
|
||||
if (isHealthy) {
|
||||
return;
|
||||
}
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
}
|
||||
this.setStatus('unhealthy');
|
||||
throw new Error('Backend failed to become healthy after 60 seconds');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user