Merge pull request #3034 from chengzhichao-xydt/codex/feishu-resource-close-error

fix: check Close() error on feishu resource download
This commit is contained in:
Mauro 2026-06-07 14:58:21 +02:00 committed by GitHub
commit ebb04abb38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

BIN
.gitignore vendored

Binary file not shown.

View file

@ -1013,7 +1013,13 @@ func (c *FeishuChannel) storeResourceFile(
}) })
return "" return ""
} }
out.Close() if closeErr := out.Close(); closeErr != nil {
logger.ErrorCF("feishu", "Failed to close downloaded resource file", map[string]any{
"error": closeErr.Error(),
})
os.Remove(localPath)
return ""
}
ref, err := store.Store(localPath, media.MediaMeta{ ref, err := store.Store(localPath, media.MediaMeta{
Filename: filename, Filename: filename,