This repository was archived by the owner on Dec 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 11
enhancement: refactor and improve process function and webhook endpoints #59
Merged
Conversation
This file contains 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
to avoid sqlite locks its probably a bit slower, but should not get a "database is locked" anymore
you can now trigger arrs or lists individually via POST `omegabrr arr` and `omegabrr lists` now only trigger the given type
zze0s
reviewed
May 7, 2023
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.
Overall good a good improvement but I would still split the logic out a bit more. It will function the same but give some separation to it.
Tried to make all the suggestions you mentioned and also moved these into each case in main.go instead of having them in the ProcessArrs and ProcessLists to avoid them being printed twice during if len(processingErrors) == 0 {
log.Info().Msgf("Run complete.")
} else {
log.Warn().Msgf("Run complete, with errors.")
log.Warn().Msg("Errors encountered during processing:")
for _, errMsg := range processingErrors {
log.Warn().Msg(errMsg)
}
} |
zze0s
approved these changes
May 15, 2023
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.
Big PR :D looks good!
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 PR introduces several improvements and fixes.
Fixed:
arr
andlists
now only update the given type, not both. (On latest, both commands do the exact same thing: they update everything)Improvements:
Webhook endpoints now reflect the changes above.
Reduce risk of db locks
Changed goroutines in service.go to a range loop to avoid autobrr db locks by updating one filter at a time instead of everything simultaneously. It takes a few more seconds but will improve stability overall.
Better error logging
Minor improvements to error logging, resulting in more detailed and informative error messages in the summary displayed at the end of each run.
Improved help message and config search methods
Improve help message and add config search methods: The help message has been updated for better clarity, and the application now looks for configuration files in multiple locations, including the default user configuration directory and the specified OMEGABRR_CONFIG environment variable.