mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-03 05:08:06 -06:00
[chore/performance] Update media prune logic, add extra CLI command (#1474)
* start updating media prune stuff a wee bit * continue prune / uncache work * more tidying + consistency stuff * add prune CLI command * docs * arg
This commit is contained in:
parent
70739d32cc
commit
40bc03e717
31 changed files with 1113 additions and 1090 deletions
|
|
@ -82,10 +82,10 @@ import (
|
|||
// type (the first of four ASCII letters) is lower-case.
|
||||
const chunkTypeAncillaryBit = 0x20000000
|
||||
|
||||
// PNGAncillaryChunkStripper wraps another io.Reader to strip ancillary chunks,
|
||||
// pngAncillaryChunkStripper wraps another io.Reader to strip ancillary chunks,
|
||||
// if the data is in the PNG file format. If the data isn't PNG, it is passed
|
||||
// through unmodified.
|
||||
type PNGAncillaryChunkStripper struct {
|
||||
type pngAncillaryChunkStripper struct {
|
||||
// Reader is the wrapped io.Reader.
|
||||
Reader io.Reader
|
||||
|
||||
|
|
@ -113,7 +113,7 @@ type PNGAncillaryChunkStripper struct {
|
|||
}
|
||||
|
||||
// Read implements io.Reader.
|
||||
func (r *PNGAncillaryChunkStripper) Read(p []byte) (int, error) {
|
||||
func (r *pngAncillaryChunkStripper) Read(p []byte) (int, error) {
|
||||
for {
|
||||
// If the wrapped io.Reader returned a non-nil error, drain r.buffer
|
||||
// (what data we have) and return that error (if fully drained).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue