f3lixding / dookie

A highly opinionated home automation server that I am writing for my own shitty little set up, hence the name.
0 stars 0 forks source link

Dedup creation of channels #22

Open f3lixding opened 5 days ago

f3lixding commented 5 days ago

Sometimes, when the shard is shutting down (and another one is restarting), the channel info would sometimes be unretrievable:

./dookied.log.2024-09-26-2024-09-26T16:54:49.026301Z  INFO run:shutdown{shard_id=ShardId(0) code=4000}: serenity::gateway::bridge::shard_queuer: Shutting down shard 0
./dookied.log.2024-09-26-2024-09-26T16:54:49.199902Z  INFO run: serenity::gateway::bridge::shard_runner: [ShardRunner ShardInfo { id: ShardId(0), total: 1 }] Running
./dookied.log.2024-09-26-2024-09-26T16:54:49.361575Z ERROR dookie_server_lib::discord_bot::discord_bot: Error retrieving channel info from guild.
./dookied.log.2024-09-26:2024-09-26T16:54:49.361812Z  INFO dookie_server_lib::discord_bot::discord_bot: Creating channel: admin-notifications
./dookied.log.2024-09-26:2024-09-26T16:54:49.591858Z  INFO dookie_server_lib::discord_bot::discord_bot: Creating channel: general-notifications

This is because the init logic does not require the channel info to be present: https://github.com/f3lixding/dookie/blob/e1a8142aec32bd0413d6b03d761a0781e095196c/server/src/discord_bot/discord_bot.rs#L262-L265

But more importantly, perhaps we should find out why the channel info retrieval is erroring out.