Closed sideninja closed 4 weeks ago
The changes introduce a new private method uninstallFilter
in the PullAPI
struct, which centralizes the filter uninstallation logic. The public UninstallFilter
method now merely handles mutex locking and delegates to this new method. Additionally, GetFilterLogs
and GetFilterChanges
have been updated to utilize uninstallFilter
for expired filters, enhancing code organization while preserving existing functionality.
File | Change Summary |
---|---|
api/pull.go | Introduced uninstallFilter method to encapsulate filter uninstallation logic; modified UninstallFilter to call uninstallFilter . Updated GetFilterLogs and GetFilterChanges to use uninstallFilter for expired filters. |
sequenceDiagram
participant Client
participant PullAPI
participant Mutex
Client->>PullAPI: Call UninstallFilter(id)
PullAPI->>Mutex: Lock
PullAPI->>PullAPI: Call uninstallFilter(id)
PullAPI-->>Mutex: Unlock
PullAPI->>Client: Return result
🐰 "In the code where filters play,
A new method leads the way.
With locks in place, it hops with glee,
Organizing logic, oh so free!
Expired filters, no more dread,
The rabbit dances, code well-fed!" 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Prevent dead-lock on the log filters
For contributor use:
master
branchFiles changed
in the Github PR explorerSummary by CodeRabbit
Bug Fixes
Refactor