diff options
author | 2024-01-17 14:54:30 +0000 | |
---|---|---|
committer | 2024-01-17 14:54:30 +0000 | |
commit | 906639ad7eb92e9d631599f78979908930e59c84 (patch) | |
tree | dfef6d0a5ba47c49c214e4537a89dee6ad528df8 /internal/processing/admin | |
parent | [bugfix] Better Postgres search case insensitivity (#2526) (diff) | |
download | gotosocial-906639ad7eb92e9d631599f78979908930e59c84.tar.xz |
[chore] update viper version (#2539)
* update viper version
* removes our last uses of the slice package
* fix tests
Diffstat (limited to 'internal/processing/admin')
-rw-r--r-- | internal/processing/admin/actions.go | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/internal/processing/admin/actions.go b/internal/processing/admin/actions.go index b85f05065..0c959b1c5 100644 --- a/internal/processing/admin/actions.go +++ b/internal/processing/admin/actions.go @@ -19,6 +19,7 @@ package admin import ( "context" + "slices" "sync" "time" @@ -26,7 +27,6 @@ import ( "github.com/superseriousbusiness/gotosocial/internal/gtsmodel" "github.com/superseriousbusiness/gotosocial/internal/log" "github.com/superseriousbusiness/gotosocial/internal/state" - "golang.org/x/exp/slices" ) func errActionConflict(action *gtsmodel.AdminAction) gtserror.WithCode { @@ -140,8 +140,16 @@ func (a *Actions) GetRunning() []*gtsmodel.AdminAction { // Order by ID descending (creation date). slices.SortFunc( running, - func(a *gtsmodel.AdminAction, b *gtsmodel.AdminAction) bool { - return a.ID > b.ID + func(a *gtsmodel.AdminAction, b *gtsmodel.AdminAction) int { + const k = -1 + switch { + case a.ID > b.ID: + return +k + case a.ID < b.ID: + return -k + default: + return 0 + } }, ) |