Skip to content

Commit

Permalink
Fix for edge cases when locks aren't released
Browse files Browse the repository at this point in the history
Because the scheduler had the same amount of time, you can have a
race condition that lock isn't over yet.
  • Loading branch information
glamorous committed Nov 26, 2020
1 parent 26caf16 commit 3926a8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Console/SnapshotCommand.php
Expand Up @@ -31,7 +31,7 @@ class SnapshotCommand extends Command
*/
public function handle(Lock $lock, MetricsRepository $metrics)
{
if ($lock->get('metrics:snapshot', config('horizon.metrics.snapshot_lock', 300))) {
if ($lock->get('metrics:snapshot', config('horizon.metrics.snapshot_lock', 300)-30)) {
$metrics->snapshot();

$this->info('Metrics snapshot stored successfully.');
Expand Down

0 comments on commit 3926a8d

Please sign in to comment.