Merge pull request #3797 from appwrite/fix-usage-always-taking-fulltime

fix the latest time memory store
This commit is contained in:
Eldad A. Fux 2022-09-11 15:01:30 +03:00 committed by GitHub
commit ce73b44ccf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -323,7 +323,6 @@ class TimeSeries extends Calculator
$document->setAttribute('value', $value)
);
}
$this->latestTime[$metric][$period] = $time;
} catch (\Exception $e) { // if projects are deleted this might fail
if (is_callable($this->errorHandler)) {
call_user_func($this->errorHandler, $e, "sync_project_{$projectId}_metric_{$metric}");
@ -397,6 +396,7 @@ class TimeSeries extends Calculator
$value,
0
);
$this->latestTime[$metric][$period['key']] = $point['time'];
}
}
} catch (\Exception $e) { // if projects are deleted this might fail