mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 16:00:32 +00:00
update naming of classes and tests
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { NotificationService } from "./services/NotificationService";
|
||||
import { ETANotificationScheduler } from "./notifications/schedulers/ETANotificationScheduler";
|
||||
import { GetterSetterRepository } from "./repositories/GetterSetterRepository";
|
||||
|
||||
export interface ServerContext {
|
||||
repository: GetterSetterRepository;
|
||||
notificationService: NotificationService;
|
||||
notificationService: ETANotificationScheduler;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { MergedResolvers } from "./MergedResolvers";
|
||||
import { ServerContext } from "./ServerContext";
|
||||
import { UnoptimizedInMemoryRepository } from "./repositories/UnoptimizedInMemoryRepository";
|
||||
import { TimedApiBasedRepositoryLoader } from "./loaders/TimedApiBasedRepositoryLoader";
|
||||
import { NotificationService } from "./services/NotificationService";
|
||||
import { ETANotificationScheduler } from "./notifications/schedulers/ETANotificationScheduler";
|
||||
import { configDotenv } from "dotenv";
|
||||
import { loadTestData } from "./loaders/loadTestData";
|
||||
|
||||
@@ -21,16 +21,16 @@ async function main() {
|
||||
});
|
||||
|
||||
const repository = new UnoptimizedInMemoryRepository();
|
||||
let notificationService: NotificationService;
|
||||
let notificationService: ETANotificationScheduler;
|
||||
if (process.argv.length > 2 && process.argv[2] == "integration-testing") {
|
||||
await loadTestData(repository);
|
||||
notificationService = new NotificationService(repository, false);
|
||||
notificationService = new ETANotificationScheduler(repository, false);
|
||||
} else {
|
||||
const repositoryDataUpdater = new TimedApiBasedRepositoryLoader(
|
||||
repository
|
||||
);
|
||||
await repositoryDataUpdater.start();
|
||||
notificationService = new NotificationService(repository);
|
||||
notificationService = new ETANotificationScheduler(repository);
|
||||
}
|
||||
notificationService.reloadAPNsTokenIfTimePassed();
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { GetterRepository } from "../repositories/GetterRepository";
|
||||
import { GetterRepository } from "../../repositories/GetterRepository";
|
||||
import jwt from "jsonwebtoken";
|
||||
import fs from "fs";
|
||||
import { TupleKey } from "../types/TupleKey";
|
||||
import { IEta } from "../entities/entities";
|
||||
import { TupleKey } from "../../types/TupleKey";
|
||||
import { IEta } from "../../entities/entities";
|
||||
import http2 from "http2";
|
||||
|
||||
export interface ScheduledNotificationData {
|
||||
@@ -17,7 +17,7 @@ interface APNsUrl {
|
||||
host: string;
|
||||
}
|
||||
|
||||
export class NotificationService {
|
||||
export class ETANotificationScheduler {
|
||||
public readonly secondsThresholdForNotificationToFire = 180;
|
||||
|
||||
private apnsToken: string | undefined = undefined;
|
||||
@@ -113,7 +113,7 @@ export class NotificationService {
|
||||
throw new Error("APNS_BUNDLE_ID environment variable is not set correctly");
|
||||
}
|
||||
|
||||
const { path, host } = NotificationService.getAPNsFullUrlToUse(deviceId);
|
||||
const { path, host } = ETANotificationScheduler.getAPNsFullUrlToUse(deviceId);
|
||||
|
||||
const headers = {
|
||||
':method': 'POST',
|
||||
Reference in New Issue
Block a user