mirror of
https://github.com/skoelle/icloud-contacts-sync.git
synced 2026-09-17 23:40:24 +00:00
create schema if not existing
This commit is contained in:
@@ -16,6 +16,8 @@ import sys
|
||||
import time
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
import db
|
||||
|
||||
logging.basicConfig(
|
||||
level=os.environ.get("LOG_LEVEL", "INFO"),
|
||||
format="%(asctime)s [%(levelname)s] %(message)s",
|
||||
@@ -90,6 +92,12 @@ def main():
|
||||
else:
|
||||
logger.info("Mailer: deaktiviert (MAILER_ENABLED=false)")
|
||||
|
||||
logger.info("Pruefe/initialisiere Datenbank-Schema...")
|
||||
try:
|
||||
db.ensure_schema()
|
||||
except Exception:
|
||||
logger.exception("Schema-Init fehlgeschlagen — Sync wird trotzdem gestartet")
|
||||
|
||||
logger.info("Fuehre initialen Sync aus...")
|
||||
run_sync()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user