summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-02-13 21:19:51 +0100
committerLibravatar GitHub <noreply@github.com>2023-02-13 20:19:51 +0000
commit561ad71e58189d1daea28ec50cc9d4bac82dcfec (patch)
treee0286a51ab64fd971a8f2ebd58bacc4a59f8e87e /cmd
parent[performance] processing media and scheduled jobs improvements (#1482) (diff)
downloadgotosocial-561ad71e58189d1daea28ec50cc9d4bac82dcfec.tar.xz
[bugfix] Fix up `error getting account avatar/header` errors, other small fixes (#1496)
* start fiddling with media + account queries a little * initialize state when pruning * allow for unsetting remote media make sure to wait til media loaded fix silly tiny bug * move comment a bit for readability * slight reformat of fetchRemoteAccount{Avatar,Header} * fix issue after rebase * slightly neaten up logic of avatar/header media handling * remove log prefix (callername log field handles this) --------- Signed-off-by: kim <grufwub@gmail.com> Co-authored-by: kim <grufwub@gmail.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gotosocial/action/admin/media/prune/common.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/gotosocial/action/admin/media/prune/common.go b/cmd/gotosocial/action/admin/media/prune/common.go
index bd759a0d4..d21412a68 100644
--- a/cmd/gotosocial/action/admin/media/prune/common.go
+++ b/cmd/gotosocial/action/admin/media/prune/common.go
@@ -33,6 +33,7 @@ type prune struct {
dbService db.DB
storage *gtsstorage.Driver
manager media.Manager
+ state *state.State
}
func setupPrune(ctx context.Context) (*prune, error) {
@@ -44,6 +45,7 @@ func setupPrune(ctx context.Context) (*prune, error) {
if err != nil {
return nil, fmt.Errorf("error creating dbservice: %w", err)
}
+ state.DB = dbService
//nolint:contextcheck
storage, err := gtsstorage.AutoConfig()
@@ -61,6 +63,7 @@ func setupPrune(ctx context.Context) (*prune, error) {
dbService: dbService,
storage: storage,
manager: manager,
+ state: &state,
}, nil
}
@@ -73,5 +76,8 @@ func (p *prune) shutdown(ctx context.Context) error {
return fmt.Errorf("error closing dbservice: %w", err)
}
+ p.state.Caches.Stop()
+ p.state.Workers.Stop()
+
return nil
}