Skip to content

Commit

Permalink
docs: explain for future self
Browse files Browse the repository at this point in the history
  • Loading branch information
chronark committed Oct 8, 2024
1 parent 518f77a commit 479043a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/api/src/pkg/audit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export async function insertGenericAuditLogs(
let { val: bucket, err } = await cache.auditLogBucketByWorkspaceIdAndName.swr(
cacheKey,
async () => {
// do not use the transaction here, otherwise we may run into race conditions
// https://github.com/unkeyed/unkey/pull/2278
const bucket = await db.readonly.query.auditLogBucket.findFirst({
where: (table, { eq, and }) =>
and(eq(table.workspaceId, log.workspaceId), eq(table.name, log.bucket)),
Expand Down

0 comments on commit 479043a

Please sign in to comment.