Skip to content

Commit

Permalink
chg: [sync] Shuffle event uuids when fetching sightings to solve HTTP…
Browse files Browse the repository at this point in the history
… timeouts
  • Loading branch information
JakubOnderka committed Mar 27, 2024
1 parent bc842bf commit 83bbdaa
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/Model/Sighting.php
Expand Up @@ -1439,6 +1439,7 @@ public function pullSightings(array $user, ServerSyncTool $serverSync)
private function pullSightingNewWay(array $user, array $eventUuids, ServerSyncTool $serverSync)
{
$uuids = array_keys($eventUuids);
shuffle($uuids); // shuffle array to avoid keeping events with a lof ot sightings in same batch all the time
$saved = 0;
$savedEventUuids = [];
foreach (array_chunk($uuids, 50) as $chunk) {
Expand Down

0 comments on commit 83bbdaa

Please sign in to comment.