mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
add bindings and redis client arg for constructor
This commit is contained in:
@@ -4,10 +4,24 @@ import {
|
|||||||
NotificationRepository,
|
NotificationRepository,
|
||||||
ScheduledNotification
|
ScheduledNotification
|
||||||
} from "./NotificationRepository";
|
} from "./NotificationRepository";
|
||||||
|
import { createClient, RedisClientType } from "redis";
|
||||||
|
|
||||||
class RedisNotificationRepository implements NotificationRepository {
|
class RedisNotificationRepository implements NotificationRepository {
|
||||||
addOrUpdateNotification(notification: ScheduledNotification): Promise<void> {
|
constructor(
|
||||||
return Promise.resolve(undefined);
|
private redisClient = createClient({
|
||||||
|
url: process.env.REDIS_URL,
|
||||||
|
}),
|
||||||
|
) {
|
||||||
|
this.getAllNotificationsForShuttleAndStopId = this.getAllNotificationsForShuttleAndStopId.bind(this);
|
||||||
|
this.getSecondsThresholdForNotificationIfExists = this.getSecondsThresholdForNotificationIfExists.bind(this);
|
||||||
|
this.deleteNotificationIfExists = this.deleteNotificationIfExists.bind(this);
|
||||||
|
this.addOrUpdateNotification = this.addOrUpdateNotification.bind(this);
|
||||||
|
this.isNotificationScheduled = this.isNotificationScheduled.bind(this);
|
||||||
|
this.subscribeToNotificationChanges = this.subscribeToNotificationChanges.bind(this);
|
||||||
|
this.unsubscribeFromNotificationChanges = this.unsubscribeFromNotificationChanges.bind(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async addOrUpdateNotification(notification: ScheduledNotification): Promise<void> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public async deleteNotificationIfExists(lookupArguments: NotificationLookupArguments): Promise<void> {
|
public async deleteNotificationIfExists(lookupArguments: NotificationLookupArguments): Promise<void> {
|
||||||
|
|||||||
Reference in New Issue
Block a user