Add Discord sharding support and related configurations
Some checks failed
CI / Bot (Python) (push) Successful in 12s
CI / Dashboard (Next.js) (push) Failing after 9s

Enhance the bot's architecture by introducing sharding capabilities, allowing for better scalability and performance. Update environment files to include sharding options, and modify the bot's core logic to handle shard connections and latencies. Implement shard-specific logging and API synchronization, ensuring that only the primary shard performs certain tasks. Update API schemas and routes to reflect shard information, improving the overall status reporting and monitoring of the bot's performance across multiple shards.
This commit is contained in:
TheOnlyMace
2026-07-21 23:09:35 +02:00
parent 36b32de34c
commit 4f57cccea5
9 changed files with 136 additions and 12 deletions

View File

@@ -9,6 +9,16 @@ NEXT_PUBLIC_BRAND_NAME='Axiom'
# BOT_INSTANCE_ID=prod-a
# API_PORT=8001
# ── Discord sharding (optional) ───────────────────────────────────────────────
# Default (all unset): AutoShardedBot asks Discord for recommended shard count (one process).
# Multi-process cluster: same TOKEN + shared DB volume; set SHARD_COUNT + SHARD_IDS per process.
# API / slash sync / emoji sync only on the primary (shard 0 in SHARD_IDS, or SHARD_PRIMARY=true).
# SHARD_COUNT=
# SHARD_IDS=0,1
# SHARD_PRIMARY=
# Only enable API on the primary process:
# API_ENABLED=true
# ── Owner / Staff IDs (REQUIRED — comma-separated Discord user IDs) ───────────
# Set your own Discord user ID(s). No foreign IDs are used as fallback.
OWNER_IDS=YOUR_DISCORD_USER_ID_HERE