mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-21 14:17:11 +08:00
fix: delete same file twice
This commit is contained in:
@@ -144,9 +144,11 @@ class ChatChannel(Channel):
|
|||||||
# 删除临时文件
|
# 删除临时文件
|
||||||
try:
|
try:
|
||||||
os.remove(file_path)
|
os.remove(file_path)
|
||||||
|
if wav_path != file_path:
|
||||||
os.remove(wav_path)
|
os.remove(wav_path)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.warning("[WX]delete temp file error: " + str(e))
|
pass
|
||||||
|
# logger.warning("[WX]delete temp file error: " + str(e))
|
||||||
|
|
||||||
if reply.type == ReplyType.TEXT:
|
if reply.type == ReplyType.TEXT:
|
||||||
new_context = self._compose_context(
|
new_context = self._compose_context(
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ class WechatyChannel(ChatChannel):
|
|||||||
asyncio.run_coroutine_threadsafe(receiver.say(msg),loop).result()
|
asyncio.run_coroutine_threadsafe(receiver.say(msg),loop).result()
|
||||||
try:
|
try:
|
||||||
os.remove(file_path)
|
os.remove(file_path)
|
||||||
|
if sil_file != file_path:
|
||||||
os.remove(sil_file)
|
os.remove(sil_file)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user