refactor(server): reduce server logs (#11931)

close CLOUD-201
This commit is contained in:
fengmk2
2025-04-23 11:41:47 +00:00
parent ddb739fa13
commit ff133d1267
18 changed files with 70 additions and 46 deletions
@@ -133,7 +133,7 @@ export class NotificationModel extends BaseModel {
type: NotificationType.Mention,
body: data.body,
});
this.logger.log(
this.logger.debug(
`Created mention notification:${row.id} for user:${data.userId} in workspace:${data.body.workspaceId}`
);
return row as MentionNotification;
@@ -154,7 +154,7 @@ export class NotificationModel extends BaseModel {
type,
body: data.body,
});
this.logger.log(
this.logger.debug(
`Created ${type} notification ${row.id} to user ${data.userId} in workspace ${data.body.workspaceId}`
);
return row as InvitationNotification;
@@ -171,7 +171,7 @@ export class NotificationModel extends BaseModel {
type,
body: data.body,
});
this.logger.log(
this.logger.debug(
`Created ${type} notification ${row.id} to user ${data.userId} in workspace ${data.body.workspaceId}`
);
return row as InvitationReviewDeclinedNotification;
@@ -239,7 +239,9 @@ export class NotificationModel extends BaseModel {
// delete notifications that are older than one year
where: { createdAt: { lte: new Date(Date.now() - ONE_YEAR) } },
});
this.logger.log(`Deleted ${count} expired notifications`);
if (count > 0) {
this.logger.log(`Deleted ${count} expired notifications`);
}
return count;
}