mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
for development and production, swap out in memory repo for redis one
This commit is contained in:
@@ -10,6 +10,7 @@ import { loadShuttleTestData } from "./loaders/loadShuttleTestData";
|
||||
import { AppleNotificationSender } from "./notifications/senders/AppleNotificationSender";
|
||||
import { InMemoryNotificationRepository } from "./repositories/InMemoryNotificationRepository";
|
||||
import { NotificationRepository } from "./repositories/NotificationRepository";
|
||||
import { RedisNotificationRepository } from "./repositories/RedisNotificationRepository";
|
||||
|
||||
const typeDefs = readFileSync("./schema.graphqls", "utf8");
|
||||
|
||||
@@ -24,6 +25,7 @@ async function main() {
|
||||
|
||||
let notificationRepository: NotificationRepository;
|
||||
let notificationService: ETANotificationScheduler;
|
||||
|
||||
if (process.argv.length > 2 && process.argv[2] == "integration-testing") {
|
||||
console.log("Using integration testing setup")
|
||||
await loadShuttleTestData(shuttleRepository);
|
||||
@@ -43,7 +45,10 @@ async function main() {
|
||||
);
|
||||
await repositoryDataUpdater.start();
|
||||
|
||||
notificationRepository = new InMemoryNotificationRepository();
|
||||
const redisNotificationRepository = new RedisNotificationRepository();
|
||||
await redisNotificationRepository.connect();
|
||||
|
||||
notificationRepository = redisNotificationRepository;
|
||||
notificationService = new ETANotificationScheduler(
|
||||
shuttleRepository,
|
||||
notificationRepository
|
||||
|
||||
Reference in New Issue
Block a user