fix: add unique id to task struct to avoid duplicate file name overwrite, close #59

This commit is contained in:
krau
2025-05-09 08:58:30 +08:00
parent 488d709d85
commit ed99a37831
3 changed files with 11 additions and 1 deletions

View File

@@ -117,7 +117,7 @@ func AddToQueue(ctx *ext.Context, update *ext.Update) error {
if update.CallbackQuery.MsgID != record.ReplyMessageID {
record.ReplyMessageID = update.CallbackQuery.MsgID
if err := dao.SaveReceivedFile(record); err != nil {
common.Log.Errorf("更新接收的文件失败: %s", err)
common.Log.Errorf("更新记录失败: %s", err)
}
}
@@ -169,6 +169,7 @@ func AddToQueue(ctx *ext.Context, update *ext.Update) error {
task = types.Task{
Ctx: ctx,
Status: types.Pending,
FileDBID: record.ID,
File: file,
StorageName: storageName,
FileChatID: record.ChatID,