Fix disabled arr instances being processed in some cases#554
Conversation
|
@sourcery-ai review |
|
@greptileai review |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideEnsure only enabled Arr instances are processed when handling Arr configurations by iterating over the pre-filtered enabledInstances collection instead of all configured instances. Class diagram for updated Arr processing in GenericHandlerclassDiagram
class GenericHandler {
+Task ProcessArrConfigAsync(ArrConfig config, bool throwOnFailure)
-IEnumerable~ArrInstance~ enabledInstances
}
class ArrConfig {
+IEnumerable~ArrInstance~ Instances
}
class ArrInstance {
+bool Enabled
+string Name
}
GenericHandler --> ArrConfig : processes
ArrConfig --> ArrInstance : contains
GenericHandler --> ArrInstance : iterates_enabledInstances
Flow diagram for filtering and processing enabled Arr instancesflowchart TD
A[Start ProcessArrConfigAsync] --> B[Validate ArrConfig]
B --> C[Determine enabledInstances from config.Instances]
C --> D{Are there any enabledInstances?}
D -- No --> E[Return without processing]
D -- Yes --> F[Foreach arrInstance in enabledInstances]
F --> G[Process arrInstance]
G --> H{More enabledInstances?}
H -- Yes --> F
H -- No --> I[End ProcessArrConfigAsync]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Greptile SummaryThis PR fixes a bug in Confidence Score: 5/5Safe to merge — targeted one-line bug fix with no risk of regression. The change is minimal and correct: it replaces No files require special attention.
|
| Filename | Overview |
|---|---|
| code/backend/Cleanuparr.Infrastructure/Features/Jobs/GenericHandler.cs | Single-line bug fix: loop now iterates over enabledInstances instead of config.Instances, ensuring disabled arr instances are never processed. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[ProcessArrConfigAsync called] --> B[Filter: enabledInstances = config.Instances.Where x.Enabled]
B --> C{enabledInstances.Count == 0?}
C -- Yes --> D[Log debug: No enabled instances\nreturn early]
C -- No --> E[foreach arrInstance in enabledInstances]
E --> F[ProcessInstanceAsync arrInstance]
F --> G{Exception thrown?}
G -- No --> H{More instances?}
G -- Yes --> I[Log error]
I --> J{throwOnFailure?}
J -- Yes --> K[re-throw]
J -- No --> H
H -- Yes --> E
H -- No --> L[Done]
Reviews (1): Last reviewed commit: "fixed disabled arr instances being proce..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary by Sourcery
Bug Fixes: