mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-21 08:31:27 -05:00
fix: close file in the Upload func (#30262)
(cherry picked from commit 0ceecfc11ab4851863a5a6bc5e398d2baf7e86f6)
This commit is contained in:
parent
a53a94e1c2
commit
0eb2105b16
1 changed files with 2 additions and 2 deletions
|
@ -44,7 +44,7 @@ func (c *FilesystemClient) Download(ctx context.Context, objects []Pointer, call
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
defer f.Close()
|
||||||
if err := callback(p, f, nil); err != nil {
|
if err := callback(p, f, nil); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ func (c *FilesystemClient) Upload(ctx context.Context, objects []Pointer, callba
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
defer f.Close()
|
||||||
_, err = io.Copy(f, content)
|
_, err = io.Copy(f, content)
|
||||||
|
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue