From 600b6af876755b09342ab4e192d6ffe624f9c8e0 Mon Sep 17 00:00:00 2001 From: wumode Date: Fri, 6 Mar 2026 23:21:43 +0800 Subject: [PATCH] fix(openlist): transfer queue blocking --- app/modules/filemanager/storages/alist.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/modules/filemanager/storages/alist.py b/app/modules/filemanager/storages/alist.py index d836fb88..8aa523fc 100644 --- a/app/modules/filemanager/storages/alist.py +++ b/app/modules/filemanager/storages/alist.py @@ -9,6 +9,7 @@ from app.core.cache import cached from app.core.config import settings, global_vars from app.log import logger from app.modules.filemanager.storages import StorageBase, transfer_process +from app.schemas.exception import OperationInterrupted from app.schemas.types import StorageSchema from app.utils.http import RequestUtils from app.utils.singleton import WeakSingleton @@ -672,7 +673,7 @@ class Alist(StorageBase, metaclass=WeakSingleton): def read(self, size=-1): if global_vars.is_transfer_stopped(path.as_posix()): logger.info(f"【OpenList】{path} 上传已取消!") - return None + raise OperationInterrupted(f"Upload cancelled: {path}") chunk = self.file.read(size) if chunk: self.uploaded_size += len(chunk) @@ -691,6 +692,8 @@ class Alist(StorageBase, metaclass=WeakSingleton): self.__get_api_url("/api/fs/put"), data=progress_reader, ) + except OperationInterrupted: + return None finally: progress_reader.close()