move shouldSendNotifications property to the AppleNotificationSender

This commit is contained in:
2025-03-24 10:02:30 -07:00
parent a6ceeb4dfb
commit 6251f0e247
3 changed files with 11 additions and 10 deletions

View File

@@ -8,6 +8,7 @@ import { TimedApiBasedRepositoryLoader } from "./loaders/TimedApiBasedRepository
import { ETANotificationScheduler } from "./notifications/schedulers/ETANotificationScheduler";
import { configDotenv } from "dotenv";
import { loadTestData } from "./loaders/loadTestData";
import { AppleNotificationSender } from "./notifications/senders/AppleNotificationSender";
configDotenv();
@@ -24,7 +25,8 @@ async function main() {
let notificationService: ETANotificationScheduler;
if (process.argv.length > 2 && process.argv[2] == "integration-testing") {
await loadTestData(repository);
notificationService = new ETANotificationScheduler(repository, false);
const appleNotificationSender = new AppleNotificationSender(false);
notificationService = new ETANotificationScheduler(repository, appleNotificationSender);
} else {
const repositoryDataUpdater = new TimedApiBasedRepositoryLoader(
repository
@@ -32,7 +34,6 @@ async function main() {
await repositoryDataUpdater.start();
notificationService = new ETANotificationScheduler(repository);
}
notificationService.reloadAPNsTokenIfTimePassed();
const { url } = await startStandaloneServer(server, {
listen: {