Skip to content

Commit cbd0bcd

Browse files
committed
Deal with queries with 0 bytes of data
1 parent c6d1de6 commit cbd0bcd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/webapp/app/services/queryService.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export async function executeQuery<TOut extends z.ZodSchema>(
9494
// If query succeeded and history options provided, save to history
9595
if (result[0] === null && history) {
9696
const stats = result[1].stats;
97-
const byteSeconds = parseFloat(stats.byte_seconds);
97+
const byteSeconds = parseFloat(stats.byte_seconds) || 0;
9898
const costInCents = byteSeconds * env.CENTS_PER_QUERY_BYTE_SECOND;
9999

100100
await prisma.customerQuery.create({

0 commit comments

Comments
 (0)