Skip to content

Commit

Permalink
Improve config names
Browse files Browse the repository at this point in the history
  • Loading branch information
Archinowsk committed Sep 1, 2024
1 parent 4d94137 commit d0b0e0b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"test:coverage": "yarn run -T vitest run --coverage --colors",
"test:watch": "yarn run -T vitest watch",
"type-check": "yarn run -T tsc --noEmit",
"update-game-popularity": "NODE_ENV=development tsx src/test/scripts/testUpdateGamePopularity.ts",
"update-program-popularity": "NODE_ENV=development tsx src/test/scripts/testUpdateProgramItemPopularity.ts",
"verify-results": "NODE_ENV=development tsx src/test/scripts/testVerifyResults.ts",
"load-kompassi-data": "NODE_ENV=development tsx src/test/scripts/loadKompassiDataToDb.ts",
"update-kompassi-datadump": "NODE_ENV=development tsx src/test/scripts/updateKompassiDataDump.ts",
Expand Down
4 changes: 2 additions & 2 deletions server/src/features/assignment/padg/utils/assignPadg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ export const assignPadg = (
list: ListItem[],
updateL: (input: Input) => string,
): PadgRandomAssignResult[] => {
const { PADG_ASSIGNMENT_ROUNDS } = config.server();
const { padgAssignmentRounds } = config.server();

let finalHappiness = 0;
let finalAssignResults: PadgRandomAssignResult[] = [];

for (let i = 0; i < PADG_ASSIGNMENT_ROUNDS; i++) {
for (let i = 0; i < padgAssignmentRounds; i++) {
const eventsCopy = cloneDeep(events);

const input: PadgInput = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ export const runRandomAssignment = (
const list = unwrapResult(listResult);
const updateL = (input: RandomAssignUpdateLInput): ListItem[] => input.L;

const { RANDOM_ASSIGNMENT_ROUNDS } = config.server();
const { randomAssignmentRounds } = config.server();
const input = {
groups,
events,
L: list,
updateL,
assignmentRounds: RANDOM_ASSIGNMENT_ROUNDS,
assignmentRounds: randomAssignmentRounds,
};

let assignResults: AssignmentElement[] | CheckResult | undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const getRandomLotterySignup = (

// Select random program items for each start time
firstFourTimes.forEach((startTime) => {
logger.debug(`Generate signups for time ${startTime}`);
logger.debug(`Generate lottery signups for time ${startTime}`);
const programItemsForTime = activeProgramItems.filter(
(activeProgramItem) =>
dayjs(activeProgramItem.startTime).toISOString() ===
Expand Down
16 changes: 8 additions & 8 deletions shared/config/serverConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export interface ServerConfig {
jwtSecretKeyAdmin: string;
jwtSecretKeyHelp: string;
allowedCorsOrigins: readonly string[];
PADG_ASSIGNMENT_ROUNDS: number;
RANDOM_ASSIGNMENT_ROUNDS: number;
padgAssignmentRounds: number;
randomAssignmentRounds: number;
bundleCompression: boolean;
autoUpdateProgramEnabled: boolean;
programUpdateInterval: string;
Expand Down Expand Up @@ -85,8 +85,8 @@ const prodConfig = {
jwtSecretKeyHelp: process.env.JWT_SECRET_KEY_HELP ?? "",
allowedCorsOrigins: getAllowedCorsOrigins(),
debug: process.env.DEBUG === "true" || false,
PADG_ASSIGNMENT_ROUNDS: 300,
RANDOM_ASSIGNMENT_ROUNDS: 300,
padgAssignmentRounds: 300,
randomAssignmentRounds: 300,
consoleLogFormatJson: true,

// Dev
Expand All @@ -113,8 +113,8 @@ const stagingConfig = {
jwtSecretKeyHelp: process.env.JWT_SECRET_KEY_HELP ?? "",
allowedCorsOrigins: getAllowedCorsOrigins(),
debug: process.env.DEBUG === "true" || false,
PADG_ASSIGNMENT_ROUNDS: 300,
RANDOM_ASSIGNMENT_ROUNDS: 300,
padgAssignmentRounds: 300,
randomAssignmentRounds: 300,
consoleLogFormatJson: true,

// Dev
Expand Down Expand Up @@ -147,8 +147,8 @@ const devConfig = {
"http://server:5000",
]),
debug: false,
PADG_ASSIGNMENT_ROUNDS: 300,
RANDOM_ASSIGNMENT_ROUNDS: 10,
padgAssignmentRounds: 300,
randomAssignmentRounds: 10,
consoleLogFormatJson: false,

// Dev
Expand Down

0 comments on commit d0b0e0b

Please sign in to comment.