fix(python): sleep 1s to make sure data has been stored into db
This commit is contained in:
parent
45a728e507
commit
809dc883c8
6
clients/python/wcferry/client.py
vendored
6
clients/python/wcferry/client.py
vendored
@ -1,7 +1,7 @@
|
||||
#! /usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
__version__ = "39.4.2.1"
|
||||
__version__ = "39.4.2.2"
|
||||
|
||||
import atexit
|
||||
import base64
|
||||
@ -845,7 +845,8 @@ class Wcf():
|
||||
Returns:
|
||||
str: 成功返回存储路径;空字符串为失败,原因见日志。
|
||||
"""
|
||||
if self.download_attach(id, "", extra) != 0:
|
||||
sleep(1) # 强制等待 1 秒让数据入库,避免那帮人总是嗷嗷叫超时
|
||||
if (not os.path.exists(extra)) and (self.download_attach(id, "", extra) != 0):
|
||||
self.LOG.error(f"下载失败")
|
||||
return ""
|
||||
cnt = 0
|
||||
@ -871,6 +872,7 @@ class Wcf():
|
||||
Returns:
|
||||
str: 成功返回存储路径;空字符串为失败,原因见日志。
|
||||
"""
|
||||
sleep(1) # 强制等待 1 秒让数据入库,避免那帮人总是嗷嗷叫超时
|
||||
base, _ = os.path.splitext(thumb)
|
||||
file_path = base + ".mp4"
|
||||
file_name = os.path.basename(file_path)
|
||||
|
Loading…
Reference in New Issue
Block a user