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,
|
NotificationRepository,
|
||||||
ScheduledNotification
|
ScheduledNotification
|
||||||
} from "./NotificationRepository";
|
} from "./NotificationRepository";
|
||||||
import { createClient, RedisClientType } from "redis";
|
import { createClient } from "redis";
|
||||||
|
|
||||||
class RedisNotificationRepository implements NotificationRepository {
|
export class RedisNotificationRepository implements NotificationRepository {
|
||||||
constructor(
|
constructor(
|
||||||
private redisClient = createClient({
|
private redisClient = createClient({
|
||||||
url: process.env.REDIS_URL,
|
url: process.env.REDIS_URL,
|
||||||
@@ -21,6 +21,10 @@ class RedisNotificationRepository implements NotificationRepository {
|
|||||||
this.unsubscribeFromNotificationChanges = this.unsubscribeFromNotificationChanges.bind(this);
|
this.unsubscribeFromNotificationChanges = this.unsubscribeFromNotificationChanges.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isReady() {
|
||||||
|
return this.redisClient.isReady
|
||||||
|
}
|
||||||
|
|
||||||
public async connect() {
|
public async connect() {
|
||||||
await this.redisClient.connect();
|
await this.redisClient.connect();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user