Rewrite towns loading code, removed OTBM loader (was too slow)

By default load from towns table in db
This commit is contained in:
slawkens
2024-11-07 19:07:15 +01:00
parent 18bd325a44
commit c980a09146
7 changed files with 27 additions and 220 deletions

View File

@@ -25,6 +25,9 @@
namespace MyAAC;
use MyAAC\Cache\Cache;
use MyAAC\Models\Town;
class DataLoader
{
private static $locale;
@@ -78,7 +81,11 @@ class DataLoader
self::$startTime = microtime(true);
if (Towns::save()) {
$cache = Cache::getInstance();
$cache->delete('towns'); // will be reloaded after next page load
global $db;
if ($db->hasTable('towns') && Town::count() > 0) {
success(self::$locale['step_database_loaded_towns'] . self::getLoadedTime());
}
else {