Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Improved logs #188

Merged
merged 2 commits into from
Nov 21, 2023
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export interface EmailSubmissionLog {
id?: number;
code?: string;
exceptionLog?: string;
confirmationId?: string;
Expand Down
8 changes: 6 additions & 2 deletions backend/src/form/services/form.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export class FormService {

// note: everytime change the cronjob interval, need to adjust the interval below that checks new submissions
private interval = 10;
@Cron('*/10 * * * *') //Runs every 10 minutes
//@Cron('*/10 * * * *') //Runs every 10 minutes
// @Cron('*/1 * * * *') //Runs every 1 minutes
// @Cron('45 * * * * *') // Run every 45 seconds
// @Cron('*/5 * * * * *') //Runs every 5 seconds
@Cron('*/5 * * * * *') //Runs every 5 seconds
handleIDIRForm(emailTo: string) {
this.logger.debug('called every 10 mins for idir form');
const formId = process.env.IDIR_FORM_ID;
Expand Down Expand Up @@ -320,6 +320,9 @@ export class FormService {
) {
text = 'updated';
}
console.log(formId, 'Submission Data: ', JSON.stringify(eachSubmission.submission.data));
console.log(formId, 'emailTo: ', emailTo);
console.log(formId, 'emailDistrict: ', emailDistrict);
console.log(formId, 'mail to:', emailSendTo);
const email: EmailEntity = {
emailTo: [emailSendTo],
Expand Down Expand Up @@ -363,6 +366,7 @@ export class FormService {
this.logger.error(
`${formId}: Failed to send email, error logged in db`,
);
console.log("Log ID: " + emailSubmissionLogEntity.id + "\n");
return new HttpException(
{ message: err },
HttpStatus.INTERNAL_SERVER_ERROR,
Expand Down
Loading