diff --git a/app/Bus/Handlers/Commands/Metric/CreateMetricPointCommandHandler.php b/app/Bus/Handlers/Commands/Metric/CreateMetricPointCommandHandler.php index 4e065de715fe..8fdbe1ca21c6 100644 --- a/app/Bus/Handlers/Commands/Metric/CreateMetricPointCommandHandler.php +++ b/app/Bus/Handlers/Commands/Metric/CreateMetricPointCommandHandler.php @@ -79,7 +79,7 @@ public function handle(CreateMetricPointCommand $command) */ protected function findOrCreatePoint(CreateMetricPointCommand $command) { - $buffer = Carbon::now()->subMinutes($command->metric->threshold); + $buffer = Carbon::now()->subMinutes($command->metric->threshold - 1)->startOfMinute(); if ($point = MetricPoint::where('metric_id', '=', $command->metric->id)->where('value', '=', $command->value)->where('created_at', '>=', $buffer)->first()) { return $point;