mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
Create a src-level environment.ts file for all environment variables
This commit is contained in:
5
src/__mocks__/environment.ts
Normal file
5
src/__mocks__/environment.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export const PARKING_LOGGING_INTERVAL_MS = 10000;
|
||||
|
||||
export const PARKING_HISTORICAL_AVERAGE_MINIMUM_INTERVAL = 1000;
|
||||
|
||||
export const PARKING_HISTORICAL_AVERAGE_MAXIMUM_TIMESPAN = 60000 * 60 * 24;
|
||||
11
src/environment.ts
Normal file
11
src/environment.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export const PARKING_LOGGING_INTERVAL_MS = process.env.PARKING_LOGGING_INTERVAL_MS
|
||||
? parseInt(process.env.PARKING_LOGGING_INTERVAL_MS)
|
||||
: 600000; // Every 10 minutes
|
||||
|
||||
export const PARKING_HISTORICAL_AVERAGE_MINIMUM_INTERVAL = process.env.PARKING_HISTORICAL_AVERAGE_MINIMUM_INTERVAL
|
||||
? parseInt(process.env.PARKING_HISTORICAL_AVERAGE_MINIMUM_INTERVAL)
|
||||
: 60000 * 60 * 2;
|
||||
|
||||
export const PARKING_HISTORICAL_AVERAGE_MAXIMUM_TIMESPAN = process.env.PARKING_HISTORICAL_AVERAGE_MAXIMUM_TIMESPAN
|
||||
? parseInt(process.env.PARKING_HISTORICAL_AVERAGE_MAXIMUM_TIMESPAN)
|
||||
: 60000 * 60 * 24;
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
} from "../../entities/ParkingRepositoryEntities";
|
||||
import { HistoricalParkingAverageQueryResult, HistoricalParkingAverageQueryArguments } from "./ParkingGetterRepository";
|
||||
import { CircularQueue } from "../../types/CircularQueue";
|
||||
import { PARKING_LOGGING_INTERVAL_MS } from "./ParkingRepositoryConstants";
|
||||
import { PARKING_LOGGING_INTERVAL_MS } from "../../environment";
|
||||
|
||||
// If every 10 minutes, two weeks of data (6x per hour * 24x per day * 7x per week * 2)
|
||||
export const MAX_NUM_ENTRIES = 2016;
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
export const PARKING_LOGGING_INTERVAL_MS = process.env.PARKING_LOGGING_INTERVAL_MS
|
||||
? parseInt(process.env.PARKING_LOGGING_INTERVAL_MS)
|
||||
: 600000; // Every 10 minutes
|
||||
Reference in New Issue
Block a user