worker: fix count...

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-04-02 22:39:47 +02:00
parent d9e3045a5b
commit 02801323bf

View File

@@ -42,7 +42,7 @@ export async function eventsJob(job: Job<EventsQueuePayload>) {
async function updateEventsCount(projectId: string) {
const res = await chQuery<{ count: number }>(
`SELECT * FROM events WHERE project_id = ${escape(projectId)}`
`SELECT count(*) as count FROM events WHERE project_id = ${escape(projectId)}`
);
const count = res[0]?.count;
if (count) {