Supersedes the code-quality half of #52 with the current state of the code.
There are now four separate retry implementations with different policies:
| Location |
Policy |
cloudService.js retryApiCall() |
2 attempts, 1s fixed delay |
runningAppsProvider.js |
3 attempts, 5s fixed delay |
backupService.js withRetry() |
attempts with backoff |
hostLocationService.js |
provider fallback, no retry |
backupService.js's version is the best starting point. Extract it to src/lib/retry.js and use it everywhere, keeping per-caller attempt counts and delays as arguments rather than flattening every call site to one policy.
While doing it, cloudService.js and wordpressService.js still use console.log/console.error in places and bypass the pino logger introduced in #36.
Related
Supersedes the code-quality half of #52 with the current state of the code.
There are now four separate retry implementations with different policies:
cloudService.jsretryApiCall()runningAppsProvider.jsbackupService.jswithRetry()hostLocationService.jsbackupService.js's version is the best starting point. Extract it tosrc/lib/retry.jsand use it everywhere, keeping per-caller attempt counts and delays as arguments rather than flattening every call site to one policy.While doing it,
cloudService.jsandwordpressService.jsstill useconsole.log/console.errorin places and bypass the pino logger introduced in #36.Related