From 9e267933cb84ed981d8a3c0c462df7ecbfd56362 Mon Sep 17 00:00:00 2001 From: kwasniew Date: Mon, 13 Jan 2025 11:46:30 +0100 Subject: [PATCH] refactor: remove extra factory fn for clock --- .../features/unique-connection/unique-connection-service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/features/unique-connection/unique-connection-service.ts b/src/lib/features/unique-connection/unique-connection-service.ts index 0b212c08c2b7..f49903bd45a6 100644 --- a/src/lib/features/unique-connection/unique-connection-service.ts +++ b/src/lib/features/unique-connection/unique-connection-service.ts @@ -60,10 +60,10 @@ export class UniqueConnectionService { return { previous: previousHll.count(), current: currentHll.count() }; } - async sync(clock = new Date()): Promise { + async sync(currentTime = new Date()): Promise { if (!this.flagResolver.isEnabled('uniqueSdkTracking')) return; - const currentHour = clock.getHours(); + const currentHour = currentTime.getHours(); const currentBucket = await this.uniqueConnectionStore.get('current'); if (this.activeHour !== currentHour && currentBucket) {