mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-01 15:52:25 -05:00
[feature] Clean up/uncache remote media (#407)
* Add whereNotEmptyAndNotNull * Add GetRemoteOlderThanDays * Add GetRemoteOlderThanDays * Add PruneRemote to Manager interface * Start implementing PruneRemote * add new attachment + status to tests * fix up and test GetRemoteOlderThan * fix bad import * PruneRemote: return number pruned * add Cached column to mediaattachment * update + test pruneRemote * update mediaTest * use Cached column * upstep bun to latest version * embed structs in mediaAttachment * migrate mediaAttachment to new format * don't default cached to true * select only remote media * update db dependencies * step bun back to last working version * update pruneRemote to use Cached field * fix storage path of test attachments * add recache logic to manager * fix trimmed aspect ratio * test prune and recache * return errwithcode * tidy up different paths for emoji vs attachment * fix incorrect thumbnail type being stored * expose TransportController to media processor * implement tee-ing recached content * add thoughts of dog to test fedi attachments * test get remote files * add comment on PruneRemote * add postData cleanup to recache * test thumbnail fetching * add incredible diagram * go mod tidy * buffer pipes for recache streaming * test for client stops reading after 1kb * add media-remote-cache-days to config * add cron package * wrap logrus so it's available to cron * start and stop cron jobs gracefully
This commit is contained in:
parent
100f1280a6
commit
07727753b9
424 changed files with 637100 additions and 176498 deletions
67
vendor/modernc.org/libc/musl_freebsd_amd64.go
generated
vendored
67
vendor/modernc.org/libc/musl_freebsd_amd64.go
generated
vendored
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by 'ccgo -export-externs X -hide __syscall0,__syscall1,__syscall2,__syscall3,__syscall4,__syscall5,__syscall6,getnameinfo,gethostbyaddr_r, -nostdinc -nostdlib -o ../musl_freebsd_amd64.go -pkgname libc -static-locals-prefix _s -Iarch/x86_64 -Iarch/generic -Iobj/src/internal -Isrc/include -Isrc/internal -Iobj/include -Iinclude copyright.c ../freebsd/table.cpp.c src/ctype/isalnum.c src/ctype/isalpha.c src/ctype/isdigit.c src/internal/floatscan.c src/internal/intscan.c src/internal/shgetc.c src/math/copysignl.c src/math/fabsl.c src/math/fmodl.c src/math/rint.c src/math/scalbn.c src/math/scalbnl.c src/network/freeaddrinfo.c src/network/getaddrinfo.c src/network/gethostbyaddr.c src/network/gethostbyaddr_r.c src/network/gethostbyname.c src/network/gethostbyname2.c src/network/gethostbyname2_r.c src/network/getnameinfo.c src/network/h_errno.c src/network/inet_aton.c src/network/inet_ntop.c src/network/inet_pton.c src/network/lookup_ipliteral.c src/network/lookup_name.c src/network/lookup_serv.c src/stdio/__toread.c src/stdio/__uflow.c src/stdlib/strtod.c src/stdlib/strtol.c src/string/strdup.c src/string/strnlen.c src/string/strspn.c', DO NOT EDIT.
|
||||
// Code generated by 'ccgo -export-externs X -hide __syscall0,__syscall1,__syscall2,__syscall3,__syscall4,__syscall5,__syscall6,getnameinfo,gethostbyaddr_r, -nostdinc -nostdlib -o ../musl_freebsd_amd64.go -pkgname libc -static-locals-prefix _s -Iarch/x86_64 -Iarch/generic -Iobj/src/internal -Isrc/include -Isrc/internal -Iobj/include -Iinclude copyright.c ../freebsd/table.cpp.c src/ctype/isalnum.c src/ctype/isalpha.c src/ctype/isdigit.c src/ctype/islower.c src/ctype/isprint.c src/ctype/isspace.c src/ctype/isupper.c src/ctype/isxdigit.c src/internal/floatscan.c src/internal/intscan.c src/internal/shgetc.c src/math/copysignl.c src/math/fabsl.c src/math/fmodl.c src/math/rint.c src/math/scalbn.c src/math/scalbnl.c src/network/freeaddrinfo.c src/network/getaddrinfo.c src/network/gethostbyaddr.c src/network/gethostbyaddr_r.c src/network/gethostbyname.c src/network/gethostbyname2.c src/network/gethostbyname2_r.c src/network/getnameinfo.c src/network/h_errno.c src/network/inet_aton.c src/network/inet_ntop.c src/network/inet_pton.c src/network/lookup_ipliteral.c src/network/lookup_name.c src/network/lookup_serv.c src/stdio/__toread.c src/stdio/__uflow.c src/stdlib/bsearch.c src/stdlib/strtod.c src/stdlib/strtol.c src/string/strdup.c src/string/strnlen.c src/string/strspn.c', DO NOT EDIT.
|
||||
|
||||
package libc
|
||||
|
||||
|
|
@ -3356,6 +3356,51 @@ func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */
|
|||
return Xisdigit(tls, c)
|
||||
}
|
||||
|
||||
func Xislower(tls *TLS, c int32) int32 { /* islower.c:4:5: */
|
||||
return Bool32(uint32(c)-uint32('a') < uint32(26))
|
||||
}
|
||||
|
||||
func X__islower_l(tls *TLS, c int32, l locale_t) int32 { /* islower.c:9:5: */
|
||||
return Xislower(tls, c)
|
||||
}
|
||||
|
||||
func Xisprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */
|
||||
return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f))
|
||||
}
|
||||
|
||||
func X__isprint_l(tls *TLS, c int32, l locale_t) int32 { /* isprint.c:9:5: */
|
||||
return Xisprint(tls, c)
|
||||
}
|
||||
|
||||
func Xisspace(tls *TLS, c int32) int32 { /* isspace.c:4:5: */
|
||||
return Bool32(c == ' ' || uint32(c)-uint32('\t') < uint32(5))
|
||||
}
|
||||
|
||||
func X__isspace_l(tls *TLS, c int32, l locale_t) int32 { /* isspace.c:9:5: */
|
||||
return Xisspace(tls, c)
|
||||
}
|
||||
|
||||
func Xisupper(tls *TLS, c int32) int32 { /* isupper.c:4:5: */
|
||||
return Bool32(uint32(c)-uint32('A') < uint32(26))
|
||||
}
|
||||
|
||||
func X__isupper_l(tls *TLS, c int32, l locale_t) int32 { /* isupper.c:9:5: */
|
||||
return Xisupper(tls, c)
|
||||
}
|
||||
|
||||
func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */
|
||||
return Bool32(func() int32 {
|
||||
if 0 != 0 {
|
||||
return Xisdigit(tls, c)
|
||||
}
|
||||
return Bool32(uint32(c)-uint32('0') < uint32(10))
|
||||
}() != 0 || uint32(c)|uint32(32)-uint32('a') < uint32(6))
|
||||
}
|
||||
|
||||
func X__isxdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isxdigit.c:8:5: */
|
||||
return Xisxdigit(tls, c)
|
||||
}
|
||||
|
||||
type uintptr_t = uint64 /* alltypes.h:55:24 */
|
||||
|
||||
type intptr_t = int64 /* alltypes.h:70:15 */
|
||||
|
|
@ -6667,6 +6712,26 @@ func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */
|
|||
return -1
|
||||
}
|
||||
|
||||
func Xbsearch(tls *TLS, key uintptr, base uintptr, nel size_t, width size_t, cmp uintptr) uintptr { /* bsearch.c:3:6: */
|
||||
var try uintptr
|
||||
var sign int32
|
||||
for nel > uint64(0) {
|
||||
try = base + uintptr(width*(nel/uint64(2)))
|
||||
sign = (*struct {
|
||||
f func(*TLS, uintptr, uintptr) int32
|
||||
})(unsafe.Pointer(&struct{ uintptr }{cmp})).f(tls, key, try)
|
||||
if sign < 0 {
|
||||
nel = nel / uint64(2)
|
||||
} else if sign > 0 {
|
||||
base = try + uintptr(width)
|
||||
nel = nel - (nel/uint64(2) + uint64(1))
|
||||
} else {
|
||||
return try
|
||||
}
|
||||
}
|
||||
return uintptr(0)
|
||||
}
|
||||
|
||||
func strtox(tls *TLS, s uintptr, p uintptr, prec int32) float64 { /* strtod.c:6:20: */
|
||||
bp := tls.Alloc(232)
|
||||
defer tls.Free(232)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue