Skip to content

Commit

Permalink
🐛 time
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaultleouay committed Oct 24, 2024
1 parent b657ef9 commit a690be5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions apps/server/src/v1/monitors/trigger/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ export function registerTriggerMonitor(api: typeof monitorsApi) {
.where(
and(
eq(monitorRun.workspaceId, Number(workspaceId)),
gte(monitorRun.createdAt, new Date(lastMonth)),
),
gte(monitorRun.createdAt, new Date(lastMonth))
)
)
.all()
)[0].count;
Expand All @@ -73,8 +73,8 @@ export function registerTriggerMonitor(api: typeof monitorsApi) {
and(
eq(monitor.id, Number(id)),
eq(monitor.workspaceId, Number(workspaceId)),
isNull(monitor.deletedAt),
),
isNull(monitor.deletedAt)
)
)
.get();

Expand Down
4 changes: 2 additions & 2 deletions packages/db/src/schema/monitor_run/monitor_run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export const monitorRun = sqliteTable("monitor_run", {
workspaceId: integer("workspace_id").references(() => workspace.id),
monitorId: integer("monitor_id").references(() => monitor.id),

runnedAt: integer("runned_at", { mode: "timestamp" }),
runnedAt: integer("runned_at", { mode: "timestamp_ms" }),

createdAt: integer("created_at", { mode: "timestamp" }).default(
sql`(strftime('%s', 'now'))`,
sql`(strftime('%s', 'now'))`
),
});

0 comments on commit a690be5

Please sign in to comment.