chore: auto-fix lint & formatting [skip ci]

This commit is contained in:
github-actions[bot] 2026-08-16 14:47:01 +00:00
parent df0edbb581
commit 3bcc98efc8
9 changed files with 152 additions and 77 deletions

View file

@ -159,7 +159,9 @@ export async function getFailedSendLog(
`SELECT ${COLUMNS} FROM send_logs WHERE ok = 0 AND group_id = ? ORDER BY ts DESC LIMIT ?`,
)
.bind(groupId, limit)
: db.prepare(`SELECT ${COLUMNS} FROM send_logs WHERE ok = 0 ORDER BY ts DESC LIMIT ?`).bind(limit);
: db
.prepare(`SELECT ${COLUMNS} FROM send_logs WHERE ok = 0 ORDER BY ts DESC LIMIT ?`)
.bind(limit);
const { results } = await stmt.all<LogRow>();
return results.map(toRecord);
} catch (err) {

View file

@ -54,7 +54,10 @@ const EMPTY: DeliveryMetrics = {
recentFailures: [],
};
export async function getDeliveryMetrics(db: D1Database, groupId?: string): Promise<DeliveryMetrics> {
export async function getDeliveryMetrics(
db: D1Database,
groupId?: string,
): Promise<DeliveryMetrics> {
const where = groupId ? " WHERE group_id = ?" : "";
const and = groupId ? " AND group_id = ?" : "";
const bindGroup = (stmt: D1PreparedStatement): D1PreparedStatement =>
@ -86,7 +89,9 @@ export async function getDeliveryMetrics(db: D1Database, groupId?: string): Prom
),
).all<StatusRow>();
const duration = await bindGroup(
db.prepare(`SELECT AVG(duration_ms) AS avg FROM send_logs WHERE duration_ms IS NOT NULL${and}`),
db.prepare(
`SELECT AVG(duration_ms) AS avg FROM send_logs WHERE duration_ms IS NOT NULL${and}`,
),
).all<AvgRow>();
const attempts = await bindGroup(
db.prepare(