46 lines
1.7 KiB
Python
46 lines
1.7 KiB
Python
"""Constants used across the Discord notification subsystem."""
|
|
|
|
import os
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Token
|
|
# ---------------------------------------------------------------------------
|
|
#: Discord bot token. Loaded once at import time so the bot can decide whether
|
|
#: to start before the application factory runs.
|
|
DISCORD_BOT_TOKEN = os.getenv('DISCORD_BOT_TOKEN')
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Emoji
|
|
# ---------------------------------------------------------------------------
|
|
CHECK_EMOJI = '✅' # Green checkmark
|
|
CROSS_EMOJI = '❌' # Red X
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Timing
|
|
# ---------------------------------------------------------------------------
|
|
#: Entries older than this are dropped when the pending file is loaded.
|
|
PENDING_MAX_AGE_DAYS = 30
|
|
|
|
#: How late the daily reminder may still be sent.
|
|
REMINDER_GRACE_SECONDS = 3600
|
|
|
|
#: First wait before restarting a bot that stopped (OPS-004).
|
|
BOT_RESTART_DELAY_SECONDS = 5
|
|
|
|
#: Ceiling on that wait.
|
|
BOT_RESTART_MAX_DELAY_SECONDS = 300
|
|
|
|
#: A connection that lasted this long resets the back-off.
|
|
BOT_RESTART_RESET_SECONDS = 600
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Caching
|
|
# ---------------------------------------------------------------------------
|
|
#: How many Discord user objects to keep resolved (PERF-005).
|
|
USER_CACHE_MAX = 512
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Timezone
|
|
# ---------------------------------------------------------------------------
|
|
TIMEZONE = 'America/Toronto'
|