diff options
author | 2023-11-04 20:21:20 +0000 | |
---|---|---|
committer | 2023-11-04 20:21:20 +0000 | |
commit | 41435a6c4ee0a5b52528890edf3fbf5a9dc0a6c8 (patch) | |
tree | 987b5d7787b24f6f6e340bbcf7fd1b052fe40dfc /internal/workers/workers.go | |
parent | [docs/bugfix] fix link to swagger yaml (#2333) (diff) | |
download | gotosocial-41435a6c4ee0a5b52528890edf3fbf5a9dc0a6c8.tar.xz |
[feature] support canceling scheduled tasks, some federation API performance improvements (#2329)
Diffstat (limited to 'internal/workers/workers.go')
-rw-r--r-- | internal/workers/workers.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/internal/workers/workers.go b/internal/workers/workers.go index 8f884d427..3617ce333 100644 --- a/internal/workers/workers.go +++ b/internal/workers/workers.go @@ -23,13 +23,13 @@ import ( "runtime" "codeberg.org/gruf/go-runners" - "codeberg.org/gruf/go-sched" "github.com/superseriousbusiness/gotosocial/internal/messages" + "github.com/superseriousbusiness/gotosocial/internal/scheduler" ) type Workers struct { // Main task scheduler instance. - Scheduler sched.Scheduler + Scheduler scheduler.Scheduler // ClientAPI provides a worker pool that handles both // incoming client actions, and our own side-effects. @@ -70,9 +70,7 @@ func (w *Workers) Start() { // Get currently set GOMAXPROCS. maxprocs := runtime.GOMAXPROCS(0) - tryUntil("starting scheduler", 5, func() bool { - return w.Scheduler.Start(nil) - }) + tryUntil("starting scheduler", 5, w.Scheduler.Start) tryUntil("starting client API workerpool", 5, func() bool { return w.ClientAPI.Start(4*maxprocs, 400*maxprocs) |