mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-24 08:56:14 -06:00
remove tryUntil
This commit is contained in:
parent
4580ae194c
commit
be85a5b642
7 changed files with 30 additions and 43 deletions
|
|
@ -38,7 +38,9 @@ import (
|
|||
func initState(ctx context.Context) (*state.State, error) {
|
||||
var state state.State
|
||||
state.Caches.Init()
|
||||
state.Caches.Start()
|
||||
if err := state.Caches.Start(); err != nil {
|
||||
return nil, fmt.Errorf("error starting caches: %w", err)
|
||||
}
|
||||
|
||||
// Only set state DB connection.
|
||||
// Don't need Actions or Workers for this (yet).
|
||||
|
|
|
|||
|
|
@ -125,7 +125,9 @@ func setupList(ctx context.Context) (*list, error) {
|
|||
}
|
||||
|
||||
state.Caches.Init()
|
||||
state.Caches.Start()
|
||||
if err := state.Caches.Start(); err != nil {
|
||||
return nil, fmt.Errorf("error starting caches: %w", err)
|
||||
}
|
||||
|
||||
// Only set state DB connection.
|
||||
// Don't need Actions or Workers for this.
|
||||
|
|
|
|||
|
|
@ -42,7 +42,9 @@ func setupPrune(ctx context.Context) (*prune, error) {
|
|||
var state state.State
|
||||
|
||||
state.Caches.Init()
|
||||
state.Caches.Start()
|
||||
if err := state.Caches.Start(); err != nil {
|
||||
return nil, fmt.Errorf("error starting caches: %w", err)
|
||||
}
|
||||
|
||||
// Scheduler is required for the
|
||||
// cleaner, but no other workers
|
||||
|
|
|
|||
|
|
@ -118,11 +118,10 @@ var Start action.GTSAction = func(ctx context.Context) error {
|
|||
)
|
||||
|
||||
defer func() {
|
||||
if state.Caches.Inited() {
|
||||
// We reached a point where caches
|
||||
// were initialized. Stop them.
|
||||
state.Caches.Stop()
|
||||
}
|
||||
// Stop any started caches.
|
||||
//
|
||||
// Noop if never started.
|
||||
state.Caches.Stop()
|
||||
|
||||
if route != nil {
|
||||
// We reached a point where the API router
|
||||
|
|
@ -207,7 +206,9 @@ var Start action.GTSAction = func(ctx context.Context) error {
|
|||
|
||||
// Initialize caches
|
||||
state.Caches.Init()
|
||||
state.Caches.Start()
|
||||
if err := state.Caches.Start(); err != nil {
|
||||
return fmt.Errorf("error starting caches: %w", err)
|
||||
}
|
||||
|
||||
// Open connection to the database now caches started.
|
||||
dbService, err := bundb.NewBunDBService(ctx, state)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue