Skip to content

Commit

Permalink
add cache purge after label goes out
Browse files Browse the repository at this point in the history
  • Loading branch information
Bossett committed Nov 3, 2024
1 parent 8477a58 commit c386d5d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/emitAccountReport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { ToolsOzoneModerationEmitEvent } from '@atproto/api'
import logger from '@/helpers/logger.js'
import env from '@/env/env.js'

import purgeCacheForDid from '@/lib/getUserDetails.js'

import { pdsLimit } from '@/env/rateLimit.js'

export default async function emitAccountReport(
Expand All @@ -16,6 +18,7 @@ export default async function emitAccountReport(
)}`,
),
)

return true
}

Expand All @@ -31,5 +34,10 @@ export default async function emitAccountReport(
return false
}

if (eventInput.subject.$type === 'com.atproto.admin.defs#repoRef') {
await purgeCacheForDid(`${eventInput.subject.did}`)
logger.debug(`Purged cache for ${eventInput.subject.did}`)
}

return true
}

0 comments on commit c386d5d

Please sign in to comment.