Spaces:
Runtime error
Runtime error
Update index.js
Browse files
index.js
CHANGED
|
@@ -1444,8 +1444,6 @@ async function initialize() {
|
|
| 1444 |
|
| 1445 |
let retryCount = 0;
|
| 1446 |
const maxRetryDelay = 15000; // keep retries fast
|
| 1447 |
-
const hardRestartAfterMs = 90000;
|
| 1448 |
-
const startupAt = Date.now();
|
| 1449 |
|
| 1450 |
async function login() {
|
| 1451 |
if (!TOKEN || TOKEN.length < 10) {
|
|
@@ -1464,12 +1462,6 @@ async function initialize() {
|
|
| 1464 |
networkFix.rotateEndpoint();
|
| 1465 |
}
|
| 1466 |
|
| 1467 |
-
// If startup is stuck too long, restart quickly so HF can recover the container.
|
| 1468 |
-
if (Date.now() - startupAt >= hardRestartAfterMs) {
|
| 1469 |
-
console.error('[CRITICAL] Startup stuck too long, forcing restart...');
|
| 1470 |
-
process.exit(1);
|
| 1471 |
-
}
|
| 1472 |
-
|
| 1473 |
// Exponential backoff for retries
|
| 1474 |
retryCount++;
|
| 1475 |
const delay = Math.min(1000 * Math.pow(2, retryCount), maxRetryDelay);
|
|
|
|
| 1444 |
|
| 1445 |
let retryCount = 0;
|
| 1446 |
const maxRetryDelay = 15000; // keep retries fast
|
|
|
|
|
|
|
| 1447 |
|
| 1448 |
async function login() {
|
| 1449 |
if (!TOKEN || TOKEN.length < 10) {
|
|
|
|
| 1462 |
networkFix.rotateEndpoint();
|
| 1463 |
}
|
| 1464 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1465 |
// Exponential backoff for retries
|
| 1466 |
retryCount++;
|
| 1467 |
const delay = Math.min(1000 * Math.pow(2, retryCount), maxRetryDelay);
|