File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -98,6 +98,9 @@ def main():
9898 if start_index > file_total :
9999 raise ValueError (f"起始文件序号 { start_index } > 文件总数 { file_total } ,请修改为正确的序号值,或者删除序号缓存文件:{ index_filepath } " )
100100
101+ # 标记是否是首次上传
102+ is_first_upload = True
103+
101104 # 打印找到的所有 .md 文件
102105 for i in range (file_total ):
103106
@@ -150,10 +153,11 @@ def main():
150153 if configs .ONLY_UPLOAD :
151154 continue
152155
153- # 如果设置了首次解析等待时间 ,则等待指定时间
154- if configs .FIRST_PARSE_WAIT_TIME > 0 :
155- timeutils .print_log (f'上传成功 ,已配置【首次上传后解析等待时间】,等待 { configs .FIRST_PARSE_WAIT_TIME } 秒后再进行解析...' )
156+ # 如果是首次上传且设置了首次解析等待时间 ,则等待指定时间
157+ if is_first_upload and configs .FIRST_PARSE_WAIT_TIME > 0 :
158+ timeutils .print_log (f'首次上传成功 ,已配置【首次上传后解析等待时间】,等待 { configs .FIRST_PARSE_WAIT_TIME } 秒后再进行解析...' )
156159 time .sleep (configs .FIRST_PARSE_WAIT_TIME )
160+ is_first_upload = False
157161
158162 # 上传成功,开始切片
159163 timeutils .print_log (f'{ file_path } ,开始切片并等待解析完毕' )
Original file line number Diff line number Diff line change @@ -414,6 +414,9 @@ def check_stop():
414414 # 将停止检查函数添加到main模块
415415 main_module .check_stop = check_stop
416416
417+ # 重置is_first_upload变量
418+ main_module .is_first_upload = True
419+
417420 # 运行主程序
418421 main_module .main ()
419422 except KeyboardInterrupt :
You can’t perform that action at this time.
0 commit comments