diff options
| author | 2025-03-05 19:12:53 +0100 | |
|---|---|---|
| committer | 2025-03-05 19:12:53 +0100 | |
| commit | 69461c461b79dbeb9b55ba83d2b7308772194d7f (patch) | |
| tree | 481f39bd01ded500989faa658069db6cc0fce7dc /internal/cache/util.go | |
| parent | [feature] Add token review / delete to backend + settings panel (#3845) (diff) | |
| download | gotosocial-69461c461b79dbeb9b55ba83d2b7308772194d7f.tar.xz | |
[bugfix] Return useful err on `server start` failure (#3879)
* [bugfix] Return useful err on `server start` failure
* remove scheduler started func
* remove tryUntil
Diffstat (limited to 'internal/cache/util.go')
| -rw-r--r-- | internal/cache/util.go | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/internal/cache/util.go b/internal/cache/util.go index fde2f9ada..ceb053e34 100644 --- a/internal/cache/util.go +++ b/internal/cache/util.go @@ -19,11 +19,9 @@ package cache import ( "errors" - "time" errorsv2 "codeberg.org/gruf/go-errors/v2" "github.com/superseriousbusiness/gotosocial/internal/db" - "github.com/superseriousbusiness/gotosocial/internal/log" ) // SentinelError is an error that can be returned and checked against to indicate a non-permanent @@ -51,19 +49,3 @@ type nocopy struct{} func (*nocopy) Lock() {} func (*nocopy) Unlock() {} - -// tryUntil will attempt to call 'do' for 'count' attempts, before panicking with 'msg'. -func tryUntil(msg string, count int, do func() bool) { - for i := 0; i < count; i++ { - if do() { - // success. - return - } - - // Sleep for a little before retry (a bcakoff). - time.Sleep(time.Millisecond * 1 << (i + 1)) - } - - // panic on total failure as this shouldn't happen. - log.Panicf(nil, "failed %s after %d tries", msg, count) -} |
