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
|
## Next version
|
||||||
|
|
||||||
- add timeout for creating ws connections
|
- add timeout for creating ws connections
|
||||||
|
- fix config file not reloading when restarting bots
|
||||||
|
|
||||||
## 1.1.2 (2019-04-14)
|
## 1.1.2 (2019-04-14)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,12 +54,12 @@ def run(
|
||||||
bot_constructor: BotConstructor,
|
bot_constructor: BotConstructor,
|
||||||
config_file: str = "bot.conf",
|
config_file: str = "bot.conf",
|
||||||
) -> None:
|
) -> None:
|
||||||
# Load the config file
|
|
||||||
config = configparser.ConfigParser(allow_no_value=True)
|
|
||||||
config.read(config_file)
|
|
||||||
|
|
||||||
async def _run() -> None:
|
async def _run() -> None:
|
||||||
while True:
|
while True:
|
||||||
|
# Load the config file
|
||||||
|
config = configparser.ConfigParser(allow_no_value=True)
|
||||||
|
config.read(config_file)
|
||||||
|
|
||||||
bot = bot_constructor(config, config_file)
|
bot = bot_constructor(config, config_file)
|
||||||
await bot.run()
|
await bot.run()
|
||||||
|
|
||||||
|
|
@ -70,12 +70,12 @@ def run_modulebot(
|
||||||
module_constructors: Dict[str, ModuleConstructor],
|
module_constructors: Dict[str, ModuleConstructor],
|
||||||
config_file: str = "bot.conf",
|
config_file: str = "bot.conf",
|
||||||
) -> None:
|
) -> None:
|
||||||
# Load the config file
|
|
||||||
config = configparser.ConfigParser(allow_no_value=True)
|
|
||||||
config.read(config_file)
|
|
||||||
|
|
||||||
async def _run() -> None:
|
async def _run() -> None:
|
||||||
while True:
|
while True:
|
||||||
|
# Load the config file
|
||||||
|
config = configparser.ConfigParser(allow_no_value=True)
|
||||||
|
config.read(config_file)
|
||||||
|
|
||||||
modulebot = modulebot_constructor(config, config_file,
|
modulebot = modulebot_constructor(config, config_file,
|
||||||
module_constructors)
|
module_constructors)
|
||||||
await modulebot.run()
|
await modulebot.run()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue