mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-02-03 10:35:15 +08:00
fix: known issue
This commit is contained in:
@@ -225,7 +225,7 @@ class U115Pan(StorageBase, metaclass=WeakSingleton):
|
||||
retry_times = kwargs.pop("retry_limit", 5)
|
||||
|
||||
# qps 速率限制
|
||||
if endpoint in self.qps_limiter.keys():
|
||||
if endpoint in self.qps_limiter:
|
||||
self.qps_limiter[endpoint].acquire()
|
||||
|
||||
try:
|
||||
@@ -509,7 +509,7 @@ class U115Pan(StorageBase, metaclass=WeakSingleton):
|
||||
return schemas.FileItem(
|
||||
storage=self.schema.value,
|
||||
fileid=str(info_resp["file_id"]),
|
||||
path=str(target_path)
|
||||
path=target_path.as_posix()
|
||||
+ ("/" if info_resp["file_category"] == "0" else ""),
|
||||
type="file" if info_resp["file_category"] == "1" else "dir",
|
||||
name=info_resp["file_name"],
|
||||
|
||||
@@ -400,9 +400,10 @@ class QpsRateLimiter:
|
||||
"""
|
||||
获取调用许可,阻塞直到满足速率限制
|
||||
"""
|
||||
sleep_duration = 0
|
||||
with self.lock:
|
||||
now = time.monotonic()
|
||||
wait_time = self.next_call_time - now
|
||||
if wait_time > 0:
|
||||
time.sleep(wait_time)
|
||||
sleep_duration = self.next_call_time - now
|
||||
self.next_call_time = max(now, self.next_call_time) + self.interval
|
||||
if sleep_duration > 0:
|
||||
time.sleep(sleep_duration)
|
||||
|
||||
Reference in New Issue
Block a user