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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support mutiple *arr servers #1327

Merged
merged 8 commits into from
Nov 9, 2024
Merged

Conversation

benscobie
Copy link
Collaborator

@benscobie benscobie commented Oct 19, 2024

Adds support for multiple *arr servers as requested here: https://features.maintainerr.info/posts/1/multipe-arr-support. Existing settings are migrated to the new format.

Some other commits alongside this to fix a few things raised recently.

Improve Plex API failure logging

Include endpoint and api name in axios error messages
Only a few calls were logging the endpoint. The logger is also overridden so that the correct context gets logged. Resolves: https://features.maintainerr.info/posts/35/logging-more-details-when-using-debug-true

We now get this:
[DEBUG] [OverseerrApi] POST request to http://overseerr.home.arpa//api/v1/settings/jobs/availability-sync/run failed: AxiosError: Request failed with status code 404

Instead of this:
[DEBUG] [undefined] POST request failed: AxiosError: Request failed with status code 404

Improve manual collection and rule execution
The API had hung when I was testing server failure modes, there were a few places where exceptions could be thrown that wouldn't be caught which might lead to a crash:

  • Add missing awaits
  • Improve setTimeout usages
  • Catch and log any exceptions in the controller
  • Only debounce subsequent actions

Trim trailing slash in Overseerr URL
Not sure if this is just a Firefox thing, but my Overseerr URL gets a slash appended to the end which breaks API requests to it.

@benscobie
Copy link
Collaborator Author

benscobie commented Oct 19, 2024

Just had a thought that I should reset the caches when a setting has been updated.

@benscobie benscobie force-pushed the multiple-arr branch 2 times, most recently from 0075916 to 451e331 Compare October 19, 2024 22:56
@jorenn92
Copy link
Owner

Hey, thanks for the great work again! This is a big one, I’ll need some time to process everything.

@benscobie
Copy link
Collaborator Author

I’ll need some time to process everything.

Of course 😄 Feel free to hit me up on Discord if you any questions

Copy link
Owner

@jorenn92 jorenn92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ve finally gone through the code and didn’t notice anything breaking, though it still needs thorough testing. What’s your opinion on merging it into the dev branch? Do you think it’s not quite ready yet, or are you confident we can move forward?

Personally, I believe we could merge it to dev so others can start testing it as well.

@benscobie
Copy link
Collaborator Author

I’ve finally gone through the code and didn’t notice anything breaking, though it still needs thorough testing. What’s your opinion on merging it into the dev branch? Do you think it’s not quite ready yet, or are you confident we can move forward?

Personally, I believe we could merge it to dev so others can start testing it as well.

I am fairly confident it works as expected 😄 I'll rebase it tonight and give everything a once over again.

Plex-api throws its own exceptions for API errors so lets log these. Previously all calls presumed success and you'd get a 'Cannot read properties of undefined' error.
- Add missing awaits
- Improve setTimeout usages
- Catch and log any exceptions in the controller
- Only debounce subsequent actions
There's no need to reset the CacheManager cache here as a process might be running using an old client. Stale data is already removed by TTL.
My URL is getting saved with a slash at the end which breaks all API requests as you get this: //api/v1
@benscobie benscobie marked this pull request as ready for review November 9, 2024 22:06
@benscobie benscobie enabled auto-merge November 9, 2024 22:13
@benscobie benscobie merged commit ef8a333 into jorenn92:main Nov 9, 2024
3 checks passed
@benscobie benscobie deleted the multiple-arr branch November 9, 2024 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants