Skip to content

Commit 3616345

Browse files
committed
新增:进度查询间隔时间(秒)
1 parent d4405be commit 3616345

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

ragflows/api.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,11 @@ def parse_chunks_with_check(filename):
157157
fileutils.save(f"{fileutils.get_cache_dir()}/ragflow_fail.txt", f"{timeutils.get_now_str()} {msg}\n")
158158
return False
159159

160-
timeutils.print_log(f"[{filename}]解析进度为:{progress}")
160+
progress_percent = round(progress * 100, 2)
161+
timeutils.print_log(f"[{filename}]解析进度为:{progress_percent}%")
161162
if progress == 1:
162163
return True
163-
time.sleep(1)
164+
time.sleep(configs.PROGRESS_CHECK_INTERVAL)
164165

165166

166167
# 是否请求成功

ragflows/configs.demo.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
# 是否仅上传文件。True=仅上传文件, False=上传文件+自动解析
2626
ONLY_UPLOAD = False
2727

28+
# 进度查询间隔时间(秒)
29+
PROGRESS_CHECK_INTERVAL = 1
30+
2831

2932
def get_header():
3033
return {'authorization': AUTHORIZATION}

scripts/launcher.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ def __init__(self):
7777
self.log_handlers = [] # 添加日志处理器列表
7878
self.original_print_log = None # 保存原始的日志打印函数
7979
self.title("RagFlow Upload")
80-
self.geometry("800x600")
80+
self.geometry("800x660")
8181

8282
# 版本和仓库信息
83-
self.version = "v1.0.1" # 版本号
83+
self.version = "v1.0.2" # 版本号
8484
self.github_repo = "https://github.com/Samge0/ragflow-upload" # GitHub仓库地址
8585

8686
# 自定义图标
@@ -98,13 +98,15 @@ def __init__(self):
9898
"PARSER_ID": {"type": str, "label": "解析方式", "default": "naive"},
9999
"DOC_DIR": {"type": str, "label": "文档目录", "default": "your doc dir"},
100100
"DOC_SUFFIX": {"type": str, "label": "文档后缀", "default": "md,txt,pdf,docx"},
101+
"PROGRESS_CHECK_INTERVAL": {"type": int, "label": "进度查询间隔(秒)", "default": "1"},
102+
101103
"MYSQL_HOST": {"type": str, "label": "MySQL主机", "default": "localhost"},
102104
"MYSQL_PORT": {"type": int, "label": "MySQL端口", "default": "5455"},
103105
"MYSQL_USER": {"type": str, "label": "MySQL用户名", "default": "root"},
104106
"MYSQL_PASSWORD": {"type": str, "label": "MySQL密码", "default": "infini_rag_flow"},
105107
"MYSQL_DATABASE": {"type": str, "label": "MySQL数据库", "default": "rag_flow"},
106108
"DOC_MIN_LINES": {"type": int, "label": "最小行数", "default": "1"},
107-
"ONLY_UPLOAD": {"type": bool, "label": "仅上传文件", "default": "False"}
109+
"ONLY_UPLOAD": {"type": bool, "label": "仅上传文件", "default": "False"},
108110
}
109111

110112
self.create_ui()

0 commit comments

Comments
 (0)