mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 16:00:32 +00:00
add export and getter to check connection status
This commit is contained in:
@@ -4,9 +4,9 @@ import {
|
||||
NotificationRepository,
|
||||
ScheduledNotification
|
||||
} from "./NotificationRepository";
|
||||
import { createClient, RedisClientType } from "redis";
|
||||
import { createClient } from "redis";
|
||||
|
||||
class RedisNotificationRepository implements NotificationRepository {
|
||||
export class RedisNotificationRepository implements NotificationRepository {
|
||||
constructor(
|
||||
private redisClient = createClient({
|
||||
url: process.env.REDIS_URL,
|
||||
@@ -21,6 +21,10 @@ class RedisNotificationRepository implements NotificationRepository {
|
||||
this.unsubscribeFromNotificationChanges = this.unsubscribeFromNotificationChanges.bind(this);
|
||||
}
|
||||
|
||||
get isReady() {
|
||||
return this.redisClient.isReady
|
||||
}
|
||||
|
||||
public async connect() {
|
||||
await this.redisClient.connect();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user