From ff889f0b2b5e56960d21bce699a6f67c8248294a Mon Sep 17 00:00:00 2001 From: Zhenglai Zhang Date: Thu, 20 Aug 2020 13:19:08 +0800 Subject: [PATCH] make cleanup more aggressive (#64) * make cleanup more aggressive * fix test --- src/services/repo-cleanup/repo-cleanup.service.test.ts | 4 ++-- src/services/repo-cleanup/repo-cleanup.service.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/services/repo-cleanup/repo-cleanup.service.test.ts b/src/services/repo-cleanup/repo-cleanup.service.test.ts index 94bd128..0a3e244 100644 --- a/src/services/repo-cleanup/repo-cleanup.service.test.ts +++ b/src/services/repo-cleanup/repo-cleanup.service.test.ts @@ -50,8 +50,8 @@ describe("RepoCleanupService", () => { expect(indexServiceSpy.getLeastUsedRepos).not.toHaveBeenCalled(); diskUsageService.dataDiskUsage.next({ total: 10_000, - available: 4_000, - used: 4_000, + available: 8_000, + used: 2_000, }); expect(indexServiceSpy.getLeastUsedRepos).not.toHaveBeenCalled(); }); diff --git a/src/services/repo-cleanup/repo-cleanup.service.ts b/src/services/repo-cleanup/repo-cleanup.service.ts index e71c66f..487af28 100644 --- a/src/services/repo-cleanup/repo-cleanup.service.ts +++ b/src/services/repo-cleanup/repo-cleanup.service.ts @@ -25,7 +25,7 @@ export class RepoCleanupService { .pipe( filter(x => { const freeRatio = x.available / x.total; - return freeRatio < 0.1; + return freeRatio < 0.5; }), exhaustMap(() => { const count = this.getNumberOfReposToRemove();