Skip to content

Commit

Permalink
fix: fixed date check on log model
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Feb 27, 2025
1 parent bf42d0f commit 5ba8958
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions app/models/logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -651,12 +651,11 @@ function getQueryHash(log) {
//
// log.meta.level (log level)
//
const now = log.created_at || new Date();
const $gte =
log.created_at &&
log?.meta?.level &&
['error', 'fatal'].includes(log.meta.level)
? dayjs(new Date(log.created_at)).startOf('hour').toDate()
: dayjs(new Date(log.created_at)).startOf('day').toDate();
log?.meta?.level && ['error', 'fatal'].includes(log.meta.level)
? dayjs(new Date(now)).startOf('hour').toDate()
: dayjs(new Date(now)).startOf('day').toDate();

if (log?.meta?.level) set.add(log.meta.level);

Expand Down

0 comments on commit 5ba8958

Please sign in to comment.