add retry to platform.start instead
this is because it holds a lock and cannot be re-tried
See also 0c0aeeae4c which tried to
make it for all startup tasks
This commit is contained in:
@@ -152,16 +152,8 @@ async function runStartupTasks() {
|
||||
|
||||
// we used to run tasks in parallel but simultaneous nginx reloads was causing issues
|
||||
for (let i = 0; i < tasks.length; i++) {
|
||||
for (let attempt = 0; attempt < 3; attempt++) {
|
||||
const [error] = await safe(tasks[i]());
|
||||
if (!error) break; // task succeeded
|
||||
debug(`Startup task at index ${i} failed (attempt ${attempt}): ${error.message}`);
|
||||
// for some reason, mysql arbitrary restarts making startup tasks fail. this makes the box update stuck
|
||||
const retry = error.reason === BoxError.DATABASE_ERROR && error.code === 'PROTOCOL_CONNECTION_LOST';
|
||||
if (!retry) break;
|
||||
debug(`Will retry task at index ${i}`);
|
||||
await delay(3000);
|
||||
}
|
||||
const [error] = await safe(tasks[i]());
|
||||
if (error) debug(`Startup task at index ${i} failed: ${error.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user