Files
croccybot/bot/meta/sharding.py
Conatum 20697c4823 sharding (core): Add base sharding support.
Add `meta.args` for command line argument access.
Add command line argument support for shard number.
Add shard count to config file.
Add `meta.sharding` exposing shard properties.
Add shard number to logging methods.
Add shard number to data appid.
2021-12-22 11:28:43 +02:00

10 lines
159 B
Python

from .args import args
from .config import conf
shard_number = args.shard or 0
shard_count = conf.bot.getint('shard_count', 1)
sharded = (shard_count > 0)