Implement Config Refresh on Middleware Side#37
Merged
Conversation
| return | ||
| } | ||
|
|
||
| config.LoadYaml() |
There was a problem hiding this comment.
The call to config.LoadYaml() does not handle potential errors. Consider capturing and handling errors from config.LoadYaml() (e.g., logging the error and returning an appropriate HTTP error status) to ensure that configuration loading failures are not silently ignored.
Jacob-Stella
approved these changes
Apr 10, 2025
Mitchell-UCF-Git
approved these changes
Apr 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This one line change adds a call to LoadYaml() inside of the putYamlHandler function.
This PR works in tandem with changes coming to the GUI repo. On the GUI repo, there will be a change added which fetch the keyword every time the user switches to the SpeechInput component.
Why?
The issue we were running into was that the configuration (including the keyword) is only loaded when the server starts via config.LoadYaml. Changing the file via the API from the frontend doesn't refresh the in-memory config.
To fix this, we added the config.LoadYaml() call after updating the file in putYamlHandler.
Result:
Now when putYamlHandler is called from the frontend when the user submits a PUT call, configs are reloaded and the user can then fetch the new keyword every time they switch to the speech input component. This results in the keyword being properly updated on the SpeechInput component after being edited during the user's current session of the GUI.
Screen.Recording.2025-04-09.at.11.11.23.PM.mov