update code level
This commit is contained in:
20
src/queue.rs
20
src/queue.rs
@@ -386,7 +386,7 @@ impl TaskQueue {
|
||||
|
||||
false
|
||||
}
|
||||
|
||||
|
||||
/// 启动定期清理过期任务
|
||||
pub async fn start_periodic_cleanup(self: Arc<Self>, interval_duration: Duration) {
|
||||
let queue = Arc::clone(&self);
|
||||
@@ -790,24 +790,6 @@ impl AlbumImportWorker {
|
||||
pub struct TaskFactory;
|
||||
|
||||
impl TaskFactory {
|
||||
/// 创建缩略图生成任务
|
||||
pub fn create_thumbnail_task(
|
||||
image_id: Uuid,
|
||||
original_data: Vec<u8>,
|
||||
priority: TaskPriority,
|
||||
) -> Task {
|
||||
Task {
|
||||
id: Uuid::new_v4(),
|
||||
task_type: TaskType::ThumbnailGeneration,
|
||||
priority,
|
||||
created_at: Instant::now(),
|
||||
data: TaskData::ThumbnailGeneration {
|
||||
image_id,
|
||||
original_data,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/// 创建相册导入任务
|
||||
pub fn create_album_import_task(album_path: String, album_data: Option<Vec<u8>>) -> Task {
|
||||
Task {
|
||||
|
||||
Reference in New Issue
Block a user