Fix warm_vehicle_cache DSN handling

This commit is contained in:
2026-04-27 08:37:41 +00:00
parent 21959f1b37
commit 5eab18bfa2

View File

@@ -18,13 +18,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'pos'))
import psycopg2 import psycopg2
import redis import redis
def _fix_dsn(dsn): MASTER_DB_URL = os.environ.get('MASTER_DB_URL', 'postgresql://postgres@/nexus_autoparts')
if dsn and 'host=' not in dsn and '@/' in dsn:
dsn = dsn.replace('@/', '@localhost/')
return dsn
MASTER_DB_URL = _fix_dsn(os.environ.get('MASTER_DB_URL', 'postgresql://postgres@localhost/nexus_autoparts'))
REDIS_URL = os.environ.get('REDIS_URL', 'redis://localhost:6379/0') REDIS_URL = os.environ.get('REDIS_URL', 'redis://localhost:6379/0')
BATCH_SIZE = 5000 BATCH_SIZE = 5000
TTL_SECONDS = 3600 TTL_SECONDS = 3600