"""Configuration for the mood archiver.

No credentials required: the source is a directly-readable SQLite file
(mood.alogins.net / container `moodtracker`), bind-mounted read-only into this
container. There is nothing to fetch from Vaultwarden for this service.
"""
import os

# Our own local archive.
DB_PATH = os.environ.get("MOOD_DB_PATH", "/data/mood_archive.sqlite")

# moodtracker's SQLite file, read-only bind mount (see docker-compose.yml).
SOURCE_DB_PATH = os.environ.get("MOOD_SOURCE_DB_PATH", "/source/moodtracker/mood.db")

# Re-check this many already-synced ids on every run (cheap safety net in case
# moodtracker ever grows an edit capability; it currently only supports
# insert + delete, so this is mostly a no-op today).
OVERLAP_ROWS = int(os.environ.get("MOOD_OVERLAP_ROWS", "3"))

# Seconds between automatic sync cycles when run as a long-lived service.
# Mood entries are logged manually a few times a week at most; hourly is far
# more than enough and the read is essentially free (local SQLite file).
SYNC_INTERVAL_SECONDS = int(os.environ.get("MOOD_SYNC_INTERVAL_SECONDS", "3600"))
