diff options
author | 2022-12-21 11:17:43 +0100 | |
---|---|---|
committer | 2022-12-21 11:17:43 +0100 | |
commit | 6ebdc306edd9b1ee0d853bdad63c0fb418382eb7 (patch) | |
tree | e2e2e5262af41cbeea7dd716e9cdc53092078200 /internal/processing/media/util.go | |
parent | [chore] note broken go v1.19.4 in contributing.md (#1278) (diff) | |
download | gotosocial-6ebdc306edd9b1ee0d853bdad63c0fb418382eb7.tar.xz |
[bugfix] Close reader gracefully when streaming recache of remote media to fileserver api caller (#1281)
* close pipereader on failed data function
* gently slurp the bytes
* readability updates
* go fmt
* tidy up file server tests + add more cases
* start moving io wrappers to separate iotools package. Remove use of buffering while piping recache stream
Signed-off-by: kim <grufwub@gmail.com>
* add license text
Signed-off-by: kim <grufwub@gmail.com>
Co-authored-by: kim <grufwub@gmail.com>
Diffstat (limited to 'internal/processing/media/util.go')
-rw-r--r-- | internal/processing/media/util.go | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/internal/processing/media/util.go b/internal/processing/media/util.go index 9739e70b7..37dc87979 100644 --- a/internal/processing/media/util.go +++ b/internal/processing/media/util.go @@ -20,7 +20,6 @@ package media import ( "fmt" - "io" "strconv" "strings" ) @@ -62,16 +61,3 @@ func parseFocus(focus string) (focusx, focusy float32, err error) { focusy = float32(fy) return } - -type teeReadCloser struct { - teeReader io.Reader - close func() error -} - -func (t teeReadCloser) Read(p []byte) (n int, err error) { - return t.teeReader.Read(p) -} - -func (t teeReadCloser) Close() error { - return t.close() -} |