mirror of
https://github.com/saltbo/zpan.git
synced 2026-09-19 10:01:12 +08:00
Centralize request audit recording, preserve immutable download-task history, and derive hourly statistics and backfills from the same authoritative sources. Add durable user registration facts so admin deletion no longer destroys signup history.
10 lines
277 B
TypeScript
10 lines
277 B
TypeScript
import { formatError } from './errors'
|
|
|
|
export async function recordAuditEffect(action: string, write: () => Promise<void>): Promise<void> {
|
|
try {
|
|
await write()
|
|
} catch (error) {
|
|
console.error(`audit.write_failed action=${action} code=${formatError(error)}`)
|
|
}
|
|
}
|