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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃挕 Make it possible to edit one server's config #286

Open
MarcusOtter opened this issue Sep 1, 2022 · 3 comments
Open

馃挕 Make it possible to edit one server's config #286

MarcusOtter opened this issue Sep 1, 2022 · 3 comments
Labels
improvement 馃挕 Improvement suggestion

Comments

@MarcusOtter
Copy link
Owner

MarcusOtter commented Sep 1, 2022

Describe the improvement

I want to be able to edit a server's config (manually on the VPS) and then have that changed be applied in the server without having to restart the bot.

Problems this improvement solves

When v3 rolled out yesterday we had one server (so far) that encountered an error when changing a specific setting. I still haven't figured out the root cause, but I am 99% sure it would be fixed if I manually edited their config and reset the setting. The problem is that if I do that, the change won't be taken into account until the bot is restarted, since Needle does heavy caching and only reads the config from file if it hasn't read it before.

Alternative solutions

There are a few possible solutions. We should take #128 into account in that we might have a remote database as a storage medium in the future.

  1. Less aggressive caching
    We could try to add some kind of timer for how long guild configs should be in cache, for example 15 minutes or so. Then we could edit the config manually, and know that it would be a maximum of 15 minutes before this change is applied to the server (given that they don't overwrite it during that time)

  2. Add a bot owner command
    We could also add a guild command (not a global command) to my personal development server (or whichever guild ID is chosen with the .env file) that lets the bot owner reset the cache for a given server. With functionality like this it would be easy to expand into other developer commands if I ever need something else done while the bot is running.

Some other solutions are

  • Don't cache at all: I think this would be quite some overhead on the disk IO and I don't think this is a good idea. But I haven't tested it.
  • Add a command for administrators to reset the server's cache by themselves. This would only ever be useful if I am fixing something for them, so it would just add unnecessary clutter.

I'm leaning towards option 1 but happy to hear other suggestions :)

@MarcusOtter MarcusOtter added the improvement 馃挕 Improvement suggestion label Sep 1, 2022
@Madis0
Copy link

Madis0 commented Sep 1, 2022

If you need the cache overall, and only one server got a problem, indeed you should do the solution no. 2, because 1 would rather affect you and all servers negatively (due to more processing and additional delays).

@MarcusOtter
Copy link
Owner Author

While that is true, the CPU of the server usually sits on 2-5% usage, and the disks are pretty idle too. What I'm struggling with most is actually memory, so reducing cache might even be a good thing. I doubt it will affect it very much

@MarcusOtter
Copy link
Owner Author

Another benefit with this would be that we could bulk-edit channels for people if they had a lot and couldn't do it on their own (for example after migrations)

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

No branches or pull requests

2 participants