refactor: unify upload and delete task management #27
+3,397
−5,141
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.
Summary
This PR consolidates the separate upload and delete task management systems into a unified architecture, significantly reducing code duplication (~1000 lines removed) while improving maintainability and code reusability.
Related to rustfs/rustfs#938
Changes
Core Refactoring
TaskManagerclass (lib/task-manager.ts) that handles both upload and delete operations with a shared queue and concurrency controllib/upload-task.ts- Upload task helperslib/delete-task.ts- Delete task helpersstore/tasks.tswithuseTaskManagerStorethat manages all tasks (upload and delete) in a single storeComponent Consolidation
components/object/task/:stats.vue- Task statistics and status displaypanel.vue- Task management panel with tabslist.vue- Task list componentitem.vue- Individual task item componentStore Cleanup
store/upload-tasks.tsandstore/delete-tasks.tsas they were not being used anywhere in the codebaseuseTaskManagerStoreBug Fixes
processing-statusprop fromobject-task-statscomponent usageBenefits
Technical Details
The new architecture follows a plugin-based pattern where
TaskManageraccepts task handlers for different task types. Each task type has its own lifecycle and handler implementation, while tasks share a common interface (ManagedTask) but can have type-specific properties.Testing
Files Changed
Total: 21 files changed, 1044 insertions(+), 1221 deletions(-)