mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-06-08 01:01:26 +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)
|
retry_times = kwargs.pop("retry_limit", 5)
|
||||||
|
|
||||||
# qps 速率限制
|
# qps 速率限制
|
||||||
if endpoint in self.qps_limiter.keys():
|
if endpoint in self.qps_limiter:
|
||||||
self.qps_limiter[endpoint].acquire()
|
self.qps_limiter[endpoint].acquire()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -509,7 +509,7 @@ class U115Pan(StorageBase, metaclass=WeakSingleton):
|
|||||||
return schemas.FileItem(
|
return schemas.FileItem(
|
||||||
storage=self.schema.value,
|
storage=self.schema.value,
|
||||||
fileid=str(info_resp["file_id"]),
|
fileid=str(info_resp["file_id"]),
|
||||||
path=str(target_path)
|
path=target_path.as_posix()
|
||||||
+ ("/" if info_resp["file_category"] == "0" else ""),
|
+ ("/" if info_resp["file_category"] == "0" else ""),
|
||||||
type="file" if info_resp["file_category"] == "1" else "dir",
|
type="file" if info_resp["file_category"] == "1" else "dir",
|
||||||
name=info_resp["file_name"],
|
name=info_resp["file_name"],
|
||||||
|
|||||||
@@ -400,9 +400,10 @@ class QpsRateLimiter:
|
|||||||
"""
|
"""
|
||||||
获取调用许可,阻塞直到满足速率限制
|
获取调用许可,阻塞直到满足速率限制
|
||||||
"""
|
"""
|
||||||
|
sleep_duration = 0
|
||||||
with self.lock:
|
with self.lock:
|
||||||
now = time.monotonic()
|
now = time.monotonic()
|
||||||
wait_time = self.next_call_time - now
|
sleep_duration = self.next_call_time - now
|
||||||
if wait_time > 0:
|
|
||||||
time.sleep(wait_time)
|
|
||||||
self.next_call_time = max(now, self.next_call_time) + self.interval
|
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