Skip to content

Commit

Permalink
Make federated search index valid for a longer time
Browse files Browse the repository at this point in the history
If the new index was not build in time within the 1.5 h time frame,
the old index should be reused instead.
  • Loading branch information
mzur committed Oct 11, 2024
1 parent e4756df commit 71b4fa7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected function schedule(Schedule $schedule): void
->eachById([UpdateFederatedSearchIndex::class, 'dispatch']);
})
->name('update-federated-search-index')
// The jobs to generate the federated search index are run hourly at 55.
// The jobs to generate the federated search index are run hourly at 35.
// This should not collide with this job to request the index from another
// instance.
->hourlyAt(05)
Expand Down
5 changes: 4 additions & 1 deletion app/Jobs/GenerateFederatedSearchIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ public function handle()
});

$key = config('biigle.federated_search.cache_key');
Cache::put($key, $index, 3600);
// The index is updated hourly. Make the cached value valid for 3 hours so there
// is plenty of time to renew it. Otherwise the index is generated on the fly when
// it is requested and this might time out.
Cache::put($key, $index, 10800);
}

/**
Expand Down

0 comments on commit 71b4fa7

Please sign in to comment.