mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-01-17 13:38:20 +01:00
Fix metric point counting within threshold
This commit is contained in:
parent
3c51e5115a
commit
7dd94bd21c
@ -79,7 +79,7 @@ class CreateMetricPointCommandHandler
|
||||
*/
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user