Resync room information on startup / Redo room state management #70

Closed
opened 2021-05-23 23:28:32 +00:00 by projectmoon · 2 comments
Owner

The bot needs to sync info about all rooms it's in on startup. All of the code for this is present. We just need to add the part where it loops through the rooms it's in and calls resync on each one as a fire-and-forget task.

But on the other hand, do we actually need to store this information at all? It's already in the state store. This is only true if we can ask the SDK what rooms another user that isn't the bot is in.

The bot needs to sync info about all rooms it's in on startup. All of the code for this is present. We just need to add the part where it loops through the rooms it's in and calls resync on each one as a fire-and-forget task. But on the other hand, do we actually need to store this information at all? It's already in the state store. This is only true if we can ask the SDK what rooms another user that isn't the bot is in.
projectmoon added this to the User Accounts and State milestone 2021-05-23 23:28:32 +00:00
Author
Owner

After some testing on a small set of rooms, the SDK takes about 5ms to calculate this, while sqlite is capable of caching the query result. Problem is my code that stores users in rooms is broken, while the SDK always works. And if we add another caching layer (Redis) to the bot, for use with pub-sub anyway, we can also just cache things in redis if necessary.

After some testing on a small set of rooms, the SDK takes about 5ms to calculate this, while sqlite is capable of caching the query result. Problem is my code that stores users in rooms is broken, while the SDK always works. And if we add another caching layer (Redis) to the bot, for use with pub-sub anyway, we can also just cache things in redis if necessary.
Author
Owner

No longer necessary because of PR #71.

No longer necessary because of PR #71.
Sign in to join this conversation.
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: projectmoon/tenebrous-dicebot#70
No description provided.