diff --git a/src/lib/db/project-store.ts b/src/lib/db/project-store.ts index 9ccb86e38a..7f499ef540 100644 --- a/src/lib/db/project-store.ts +++ b/src/lib/db/project-store.ts @@ -56,12 +56,6 @@ class ProjectStore { return rows.map(this.mapRow); } - async updateHealth(healthUpdate: IProjectHealthUpdate): Promise { - await this.db(TABLE) - .where({ id: healthUpdate.id }) - .update({ health: healthUpdate.health }); - } - async get(id: string): Promise { return this.db .first(COLUMNS) diff --git a/src/lib/services/project-health-service.ts b/src/lib/services/project-health-service.ts index 1a127b6dac..177cff68b5 100644 --- a/src/lib/services/project-health-service.ts +++ b/src/lib/services/project-health-service.ts @@ -26,8 +26,6 @@ export default class ProjectHealthService { private featureTypes: Map; - private healthRatingTimer: Timer; - constructor( { projectStore, @@ -44,10 +42,6 @@ export default class ProjectHealthService { this.featureTypeStore = featureTypeStore; this.featureToggleStore = featureToggleStore; this.featureTypes = new Map(); - this.healthRatingTimer = setInterval( - () => this.setHealthRating(), - MILLISECONDS_IN_ONE_HOUR, - ).unref(); } async getProjectHealthReport( @@ -148,22 +142,4 @@ export default class ProjectHealthService { ); return rating; } - - async setHealthRating(): Promise { - const projects = await this.projectStore.getAll(); - - await Promise.all( - projects.map(async project => { - const newHealth = await this.calculateHealthRating(project); - await this.projectStore.updateHealth({ - id: project.id, - health: newHealth, - }); - }), - ); - } - - destroy(): void { - clearInterval(this.healthRatingTimer); - } } diff --git a/src/migrations/20210809124009-add-health-rating-to-project.js b/src/migrations/20210809124009-add-health-rating-to-project.js deleted file mode 100644 index cc9a325c91..0000000000 --- a/src/migrations/20210809124009-add-health-rating-to-project.js +++ /dev/null @@ -1,21 +0,0 @@ -exports.up = function(db, cb) { - db.runSql( - ` - ALTER TABLE projects ADD COLUMN health integer DEFAULT 100; - `, - cb, - ); -}; - -exports.down = function(db, cb) { - db.runSql( - ` - ALTER TABLE projects DROP COLUMN health; - `, - cb, - ); -}; - -exports._meta = { - version: 1, -};