Skip to content
Snippets Groups Projects

try to avoid `insert` races in `FederatedInstanceService`

Merged dakkar requested to merge feature/cope-with-insert-race-in-instanceservice into develop
  1. Oct 12, 2024
    • dakkar's avatar
      try to avoid `insert` races in `FederatedInstanceService` · 06bd29f2
      dakkar authored
      Despite the cache, different processes can race to insert a row for
      the same remote host.
      
      This is particularly apparent in our unit tests, with
      `test/unit/activitypub.ts` randomly failing.
      
      This is a (somewhat clumsy) attempt at working around that race: trap
      the "duplicate key value" error, and fetch the record.
      
      Tests pass, with or without values in the cache.
      06bd29f2
Loading