Skip to content

Commit

Permalink
Update FederationController, fix double lock bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dansup committed Dec 29, 2022
1 parent de331f2 commit 9fcccca
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions app/Http/Controllers/FederationController.php
Expand Up @@ -178,12 +178,6 @@ public function userInbox(Request $request, $username)
} else if( isset($obj['type']) && in_array($obj['type'], ['Follow', 'Accept'])) {
dispatch(new InboxValidator($username, $headers, $payload))->onQueue('follow');
} else {
$lockKey = 'pf:ap:user-inbox:activity:' . hash('sha256', $obj['id']);
if(Cache::get($lockKey) !== null) {
return;
}
Cache::put($lockKey, 1, 43200);
usleep(5000);
dispatch(new InboxValidator($username, $headers, $payload))->onQueue('high');
}
return;
Expand Down

0 comments on commit 9fcccca

Please sign in to comment.