-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
modules: always safely set up/clear memory #1569
Conversation
Thinking more about the word "safely", I am brought to the question: Wouldn't it be safer to |
It depends. Sometimes it's OK to leave stuff in Let's see if I can come up with pros/cons for each of these. |
hmmm, I was worried about that. I will rack my brain also to see where it makes sense to persist memory.
…On April 24, 2019 5:58:21 PM EDT, dgw ***@***.***> wrote:
It depends. Sometimes it's OK to leave stuff in `bot.memory` so it can
persist across module reloads (since we actually run `shutdown()` on
unload now, IIRC). Things like the short-URL cache from `url.py` come
to mind, where we don't necessarily want to have the bot hit the API
again if it sees the same URL before & after reload. Basically, I think
that just blanket-adding all of these might not be the best approach.
Let's see if I can come up with pros/cons for each of these.
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#1569 (comment)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are some evaluations of whether it makes sense to clear each memory key, as promised (though it took a bit longer than expected).
9dd4aa0
to
d3e1cc5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This brought up a new issue (which I'll open shortly), but I believe everything to be done here has been.
d3e1cc5
to
8474142
Compare
Modules will safely initialize (ensure key does not exist in memory already) in
setup()
and clean up (remove module-specific keys from memory) inshutdown()
, where necessary.