Remove image manager appUpdatePollInterval listener

This commit is contained in:
Felipe Lalanne 2021-07-21 19:18:17 -04:00
parent a1d098d8f3
commit 77070712a4
2 changed files with 2 additions and 13 deletions

View File

@ -125,7 +125,6 @@ let targetVolatilePerImageId: {
export const initialized = (async () => {
await config.initialized;
await imageManager.initialized;
await imageManager.cleanImageData();
const cleanup = async () => {
const containers = await docker.listContainers({ all: true });

View File

@ -152,18 +152,6 @@ function reportEvent(event: 'start' | 'update' | 'finish', state: Image) {
}
}
let appUpdatePollInterval: number;
export const initialized = (async () => {
await config.initialized;
appUpdatePollInterval = await config.get('appUpdatePollInterval');
config.on('change', (vals) => {
if (vals.appUpdatePollInterval != null) {
appUpdatePollInterval = vals.appUpdatePollInterval;
}
});
})();
type ServiceInfo = Pick<
Service,
'imageName' | 'appId' | 'serviceId' | 'serviceName' | 'imageId' | 'releaseId'
@ -187,6 +175,8 @@ export async function triggerFetch(
onFinish = _.noop,
serviceName: string,
): Promise<void> {
const appUpdatePollInterval = await config.get('appUpdatePollInterval');
if (imageFetchFailures[image.name] != null) {
// If we are retrying a pull within the backoff time of the last failure,
// we need to throw an error, which will be caught in the device-state