goaws
goaws copied to clipboard
Feature Request: Configuration Hot-Reload
Dear development team, The feature I am proposing is Configuration Hot-Reload.Currently, when we need to make changes to the configuration file, we have to interrupt the entire program and restart it. This is a big inconvenience because we lost all "in-memory" data
Configuration Hot-Reload will allow us to update the configuration file without the need to restart the entire program. Additionally, the update will only affect new items or modifications in the configuration file, while exclusions will remain unchanged.
I added this feature that will create a reader for events involving the configuration file. With this, it is possible to edit the file and maintain persistence without the need to restart the program. I also added a "hack" to make it work on k8s, as it does not generate a write event in the file, but a remove event instead. The code for this feature is in the PR below, and I also added a test for it.
To activate this feature, which is disabled by default, it is necessary to start goaws with the --hot-reload flag.
Thank you for your attention.
Best regards, Alexandre Pavanello.
Nice work on this one! I'll look into getting your commits into the next release - thanks for taking care of that!