From 7b8e7ea8ca32849be29e4103ce8c215e99a2bac9 Mon Sep 17 00:00:00 2001 From: Cameron Diver Date: Thu, 26 Sep 2019 15:03:36 +0100 Subject: [PATCH] Add a cache around the database application target state Change-type: minor Signed-off-by: Cameron Diver --- src/application-manager.coffee | 4 ++-- src/target-state.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/application-manager.coffee b/src/application-manager.coffee index 78ad6fed..db194c27 100644 --- a/src/application-manager.coffee +++ b/src/application-manager.coffee @@ -17,7 +17,7 @@ updateLock = require './lib/update-lock' { ContractViolationError, ContractValidationError, NotFoundError } = require './lib/errors' { pathExistsOnHost } = require './lib/fs-utils' -{ ApplicationTargetStateWrapper } = require './target-state' +{ TargetStateAccessor } = require './target-state' { ServiceManager } = require './compose/service-manager' { Service } = require './compose/service' @@ -82,7 +82,7 @@ module.exports = class ApplicationManager extends EventEmitter @_targetVolatilePerImageId = {} @_containerStarted = {} - @targetStateWrapper = new ApplicationTargetStateWrapper(this, @config, @db) + @targetStateWrapper = new TargetStateAccessor(this, @config, @db) @config.on 'change', (changedConfig) => if changedConfig.appUpdatePollInterval diff --git a/src/target-state.ts b/src/target-state.ts index c06aff70..c9e85cf5 100644 --- a/src/target-state.ts +++ b/src/target-state.ts @@ -20,7 +20,7 @@ export type DatabaseApps = DatabaseApp[]; * line. This can very quickly cause serious memory problems * and database connection timeouts. */ -export class ApplicationTargetStateWrapper { +export class TargetStateAccessor { private targetState?: DatabaseApps; public constructor( @@ -77,4 +77,4 @@ export class ApplicationTargetStateWrapper { } } -export default ApplicationTargetStateWrapper; +export default TargetStateAccessor;