Skip to content

Commit

Permalink
Update RecentAggrBatcher.php
Browse files Browse the repository at this point in the history
  • Loading branch information
zgrguric committed Aug 17, 2024
1 parent 2d8703d commit fd0afdc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/Utilities/RecentAggrBatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ private function insert(array $models, string $subject, string $identifier, Carb

private function setTo(array $models, string $subject, string $identifier, Carbon $day, int $value, string $context)
{
$identifier = $subject.'_'.$identifier;
$m = isset($models[$identifier]) ? $models[$identifier]:null;
$id = $subject.'_'.$identifier;
$m = isset($models[$id]) ? $models[$id]:null;

if($m !== null) {
$m->value_uint64 = (string)$value;
Expand Down Expand Up @@ -104,8 +104,8 @@ private function setTo(array $models, string $subject, string $identifier, Carbo

private function incrementInt(array $models, string $subject, string $identifier, Carbon $day, int $value, string $context = '')
{
$identifier = $subject.'_'.$identifier;
$m = isset($models[$identifier]) ? $models[$identifier]:null;
$id = $subject.'_'.$identifier;
$m = isset($models[$id]) ? $models[$id]:null;

if($m !== null) {
$m->value_uint64 = (string)BigInteger::of($m->value_uint64)->plus($value);
Expand All @@ -117,7 +117,7 @@ private function incrementInt(array $models, string $subject, string $identifier
$m->value_uint64 = (string)$value;
$m->day = $day->startOfDay();
$m->context = $context;
$this->collections[$day->format('Y-m-d')][$m->uniqueIdentifier()] = $m;
$this->collections[$day->format('Y-m-d')][$id] = $m;
}

//echo 'INC start'.PHP_EOL;
Expand Down

0 comments on commit fd0afdc

Please sign in to comment.