Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions backend/src/entities/cron-jobs/cron-jobs.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ export class CronJobsService {
}

private getCurrentTime(): string {
const now = new Date();
return `${now.getHours()}:${now.getMinutes()}:${now.getSeconds()}`;
return Constants.CURRENT_TIME_FORMATTED();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class CheckUsersActionsAndMailingUsersUseCase implements ICheckUsersActio
public async execute(): Promise<Array<string>> {
try {
const distinctUsers = await this.findDistinctUsersForProcessing();
const batchSize = 10;
const batchSize = 2;
const queue = new PQueue({ concurrency: 3 });
const emails: string[] = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class CheckUsersLogsAndUpdateActionsUseCase implements ICheckUsersLogsAnd
console.info('Updating actions started');
const uniqueUserIds: Array<string> = await this.findDistinctUserIdsWithNonFinishedActions();

const batchSize = 10;
const batchSize = 3;
for (let i = 0; i < uniqueUserIds.length; i += batchSize) {
const batch = uniqueUserIds.slice(i, i + batchSize);
await Promise.allSettled(
Expand Down
5 changes: 2 additions & 3 deletions backend/src/helpers/constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ export const Constants = {

CURRENT_TIME_FORMATTED: (): string => {
const now = new Date();
return now.toISOString();
// const padString = (n: number) => n.toString().padStart(2, '0');
// return `${padString(now.getHours())}:${padString(now.getMinutes())}:${padString(now.getSeconds())}`;
const padString = (n: number) => n.toString().padStart(2, '0');
return `${padString(now.getHours())}:${padString(now.getMinutes())}:${padString(now.getSeconds())}`;
},

ONE_WEEK_AGO: (): Date => {
Expand Down
Loading