Add minor improvements to notifyExpiredTokens

This commit is contained in:
carlosmonastyrski
2025-04-14 21:52:16 -03:00
parent cac4f30ca8
commit 86d7fca8fb
3 changed files with 9 additions and 6 deletions
@@ -41,6 +41,7 @@ export const serviceTokenDALFactory = (db: TDbClient) => {
.whereRaw(
`${TableName.ServiceToken}."expiresAt" < NOW() AND ${TableName.ServiceToken}."notificationSent" = false`
)
.whereNotNull(`${TableName.Users}.email`)
.select(`${TableName.ServiceToken}.name`)
.select(`${TableName.ServiceToken}.id`)
.select(`${TableName.Project}.name as projectName`)