Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caching content #3

Open
duhow opened this issue Jan 20, 2021 · 2 comments
Open

Caching content #3

duhow opened this issue Jan 20, 2021 · 2 comments

Comments

@duhow
Copy link
Collaborator

duhow commented Jan 20, 2021

One of the main concers using WebClient is that every time a Person is created or a Room is named, Errbot has to call the Slack API several times to get each piece of information. Every. Single. Message.

From #2 I'm using lru_cache to address this, but a time-based cache would be the best option in here, or even having some control to drop cache for a user when the bot does some action, such as changing the topic of a channel.

@nzlosh
Copy link
Collaborator

nzlosh commented Jan 20, 2021

I've noticed multiple calls when the bot looks up server side data. I like the idea of avoiding wasting calls to Slack if the bot has the information already. The only thing to be careful with caching is that it doesn't become stale and the bot return information that doesn't agree with Slack's state.

@duhow
Copy link
Collaborator Author

duhow commented Jan 25, 2021

 16384 Oct 25 15:50 slack_backend.db
 16384 Oct 25 15:59 text_backend.db

If this is true and I can use the Errbot Storage system to store the data, that would solve it! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants