mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 16:00:32 +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 { AppleNotificationSender } from "./notifications/senders/AppleNotificationSender";
|
||||||
import { InMemoryNotificationRepository } from "./repositories/InMemoryNotificationRepository";
|
import { InMemoryNotificationRepository } from "./repositories/InMemoryNotificationRepository";
|
||||||
import { NotificationRepository } from "./repositories/NotificationRepository";
|
import { NotificationRepository } from "./repositories/NotificationRepository";
|
||||||
|
import { RedisNotificationRepository } from "./repositories/RedisNotificationRepository";
|
||||||
|
|
||||||
const typeDefs = readFileSync("./schema.graphqls", "utf8");
|
const typeDefs = readFileSync("./schema.graphqls", "utf8");
|
||||||
|
|
||||||
@@ -24,6 +25,7 @@ async function main() {
|
|||||||
|
|
||||||
let notificationRepository: NotificationRepository;
|
let notificationRepository: NotificationRepository;
|
||||||
let notificationService: ETANotificationScheduler;
|
let notificationService: ETANotificationScheduler;
|
||||||
|
|
||||||
if (process.argv.length > 2 && process.argv[2] == "integration-testing") {
|
if (process.argv.length > 2 && process.argv[2] == "integration-testing") {
|
||||||
console.log("Using integration testing setup")
|
console.log("Using integration testing setup")
|
||||||
await loadShuttleTestData(shuttleRepository);
|
await loadShuttleTestData(shuttleRepository);
|
||||||
@@ -43,7 +45,10 @@ async function main() {
|
|||||||
);
|
);
|
||||||
await repositoryDataUpdater.start();
|
await repositoryDataUpdater.start();
|
||||||
|
|
||||||
notificationRepository = new InMemoryNotificationRepository();
|
const redisNotificationRepository = new RedisNotificationRepository();
|
||||||
|
await redisNotificationRepository.connect();
|
||||||
|
|
||||||
|
notificationRepository = redisNotificationRepository;
|
||||||
notificationService = new ETANotificationScheduler(
|
notificationService = new ETANotificationScheduler(
|
||||||
shuttleRepository,
|
shuttleRepository,
|
||||||
notificationRepository
|
notificationRepository
|
||||||
|
|||||||
Reference in New Issue
Block a user