summaryrefslogtreecommitdiff
path: root/internal/workers/workers.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-08-02 13:41:46 +0200
committerLibravatar GitHub <noreply@github.com>2024-08-02 12:41:46 +0100
commit7b5917d6ae48f83c92f92d7277960cfa6ae8ec56 (patch)
tree93ee6999195060714f41f9b9476d4d76ad50520c /internal/workers/workers.go
parent[chore] Take account of rotation data when calculating full size image dimens... (diff)
downloadgotosocial-7b5917d6ae48f83c92f92d7277960cfa6ae8ec56.tar.xz
[feature] Allow import of following and blocks via CSV (#3150)
* [feature] Import follows + blocks via settings panel * test import follows
Diffstat (limited to 'internal/workers/workers.go')
-rw-r--r--internal/workers/workers.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/workers/workers.go b/internal/workers/workers.go
index 377a9d899..657522903 100644
--- a/internal/workers/workers.go
+++ b/internal/workers/workers.go
@@ -49,6 +49,11 @@ type Workers struct {
// for asynchronous dereferencer jobs.
Dereference FnWorkerPool
+ // Processing provides a worker pool
+ // for asynchronous processing jobs,
+ // eg., import tasks, admin tasks.
+ Processing FnWorkerPool
+
// prevent pass-by-value.
_ nocopy
}
@@ -81,6 +86,10 @@ func (w *Workers) Start() {
n = 4 * maxprocs
w.Dereference.Start(n)
log.Infof(nil, "started %d dereference workers", n)
+
+ n = 4 * maxprocs
+ w.Processing.Start(n)
+ log.Infof(nil, "started %d processing workers", n)
}
// Stop will stop all of the contained
@@ -101,6 +110,9 @@ func (w *Workers) Stop() {
w.Dereference.Stop()
log.Info(nil, "stopped dereference workers")
+
+ w.Processing.Stop()
+ log.Info(nil, "stopped processing workers")
}
// nocopy when embedded will signal linter to