-
Notifications
You must be signed in to change notification settings - Fork 45
feat: Implement dynamic config change handling for blacklist paths #197
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
Conversation
Refactor the configuration loading logic into a new `update_config()` private method
to centralize configuration fetching and processing. This ensures that all
configuration values are consistently reloaded when the D-Bus configuration changes.
Improvements to path handling include:
- `process_blacklist_paths()`: Canonicalize absolute paths, remove duplicate entries
using an `unordered_set`, and explicitly ensure `.cache` is always part of
the blacklist for more robust event filtering.
- `indexing_paths_`: Properly resolve `$HOME` and filter out invalid relative paths.
These changes enhance the robustness and maintainability of the configuration
management within the daemon.
- Add new index job type 'refresh' for index management - Refactor event_handler_config from shared_ptr to value semantics - Implement config change handling in base_event_handler and default_event_handler - Add thread-safe config access with mutex protection - Enhance blacklist path processing with absolute path detection - Improve file index manager refresh with NRT (Near Real-Time) support - Add config event queue for handling configuration changes asynchronously - Support blacklist path additions/removals without full index restart - Add config event types for different blacklist operations - Implement string list diff algorithm for config change detection Task: https://pms.uniontech.com/task-view-385089.html
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.
Sorry @wangrong1069, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
deepin pr auto review我来对这段代码的变更进行审查,主要从语法逻辑、代码质量、性能和安全几个方面进行分析:
// 在 base_event_handler.h 中
enum class ConfigChangeResult {
SUCCESS,
NOT_SUPPORTED,
INVALID_VALUE,
ACCESS_DENIED
};
// 在 default_event_handler.cpp 中
class ConfigEventHandler {
public:
explicit ConfigEventHandler(GAsyncQueue* queue);
bool handleBlacklistChange(const std::vector<std::string>& old_paths,
const std::vector<std::string>& new_paths);
private:
void processPathAddition(const std::string& path);
void processPathRemoval(const std::string& path);
GAsyncQueue* queue_;
};这些改进建议旨在提高代码的可维护性、性能和安全性。建议根据实际需求和资源情况逐步实施这些改进。 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lzwind, wangrong1069 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/merge |
No description provided.