We're using smart_ip and smart_ip_ip2location_bin_db. On every cron run the module is supposed to evaluate whether the ip2location database needs to be updated. The download should happen not more than weekly or monthly, depending upon configuration.
I'm finding that instead, the download is attempted on every cron run, irrespective of when it was last downloaded.
In `SmartIpEventSubscriber.php` there is the following conditional:
<?php
if ($ipVersion || DatabaseFileUtility::needsUpdate($lastUpdateTime, $autoUpdate, DatabaseFileUtility::DOWNLOAD_MONTHLY)) {
if (empty($ipVersion)) {
// Update IPv4 IP2Location binary database first
$ipVersion = Ip2locationBinDb::IPV4_VERSION;
\Drupal::state()->set('smart_ip_ip2location_bin_db.current_ip_version_queue', $ipVersion);
}
DatabaseFileUtility::downloadDatabaseFile($ipVersion);
}
?>
It seems to me that $ipVersion will always evaluate to TRUE, therefore won't this conditional mean that the download is executed on every iteration?
I may have got this wrong, but it seems to be the case in my tests so would like to clarify.