mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-07 07:43:12 +08:00
Ensured events triggered as a result of a new visit are never skipped
This commit is contained in:
@@ -26,11 +26,13 @@ class UpdateGeoLiteDb
|
||||
$beforeDownload = fn (bool $olderDbExists) => $this->logger->notice(
|
||||
sprintf('%s GeoLite2 db file...', $olderDbExists ? 'Updating' : 'Downloading'),
|
||||
);
|
||||
$handleProgress = function (int $total, int $downloaded, bool $olderDbExists): void {
|
||||
if ($total > $downloaded) {
|
||||
$messageLogged = false;
|
||||
$handleProgress = function (int $total, int $downloaded, bool $olderDbExists) use (&$messageLogged): void {
|
||||
if ($messageLogged || $total > $downloaded) {
|
||||
return;
|
||||
}
|
||||
|
||||
$messageLogged = true;
|
||||
$this->logger->notice(sprintf('Finished %s GeoLite2 db file', $olderDbExists ? 'updating' : 'downloading'));
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user