Fix config file not reloading on bot restart
This commit is contained in:
parent
d9f25a04fb
commit
de4ba53de8
2 changed files with 9 additions and 8 deletions
|
|
@ -3,6 +3,7 @@
|
|||
## Next version
|
||||
|
||||
- add timeout for creating ws connections
|
||||
- fix config file not reloading when restarting bots
|
||||
|
||||
## 1.1.2 (2019-04-14)
|
||||
|
||||
|
|
|
|||
|
|
@ -54,12 +54,12 @@ def run(
|
|||
bot_constructor: BotConstructor,
|
||||
config_file: str = "bot.conf",
|
||||
) -> None:
|
||||
# Load the config file
|
||||
config = configparser.ConfigParser(allow_no_value=True)
|
||||
config.read(config_file)
|
||||
|
||||
async def _run() -> None:
|
||||
while True:
|
||||
# Load the config file
|
||||
config = configparser.ConfigParser(allow_no_value=True)
|
||||
config.read(config_file)
|
||||
|
||||
bot = bot_constructor(config, config_file)
|
||||
await bot.run()
|
||||
|
||||
|
|
@ -70,12 +70,12 @@ def run_modulebot(
|
|||
module_constructors: Dict[str, ModuleConstructor],
|
||||
config_file: str = "bot.conf",
|
||||
) -> None:
|
||||
# Load the config file
|
||||
config = configparser.ConfigParser(allow_no_value=True)
|
||||
config.read(config_file)
|
||||
|
||||
async def _run() -> None:
|
||||
while True:
|
||||
# Load the config file
|
||||
config = configparser.ConfigParser(allow_no_value=True)
|
||||
config.read(config_file)
|
||||
|
||||
modulebot = modulebot_constructor(config, config_file,
|
||||
module_constructors)
|
||||
await modulebot.run()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue