mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-01-29 11:08:53 +01:00
Merge pull request #2998 from JordyvanDortmont/2.4
Fix metric point counting within threshold
This commit is contained in:
commit
7d9fbb843a
@ -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