mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-10-31 22:18:52 +00:00
ensure delivery worker gets inited in testrig
This commit is contained in:
parent
51f6fd5986
commit
39e6d05b6c
1 changed files with 10 additions and 6 deletions
|
@ -30,7 +30,7 @@ import (
|
|||
"github.com/superseriousbusiness/gotosocial/internal/filter/visibility"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/messages"
|
||||
tlprocessor "github.com/superseriousbusiness/gotosocial/internal/processing/timeline"
|
||||
wprocessor "github.com/superseriousbusiness/gotosocial/internal/processing/workers"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/processing/workers"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/state"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/timeline"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/typeutils"
|
||||
|
@ -44,6 +44,8 @@ func StartNoopWorkers(state *state.State) {
|
|||
state.Workers.ProcessFromClientAPI = func(context.Context, messages.FromClientAPI) error { return nil }
|
||||
state.Workers.ProcessFromFediAPI = func(context.Context, messages.FromFediAPI) error { return nil }
|
||||
|
||||
state.Workers.Delivery.Init(nil)
|
||||
|
||||
_ = state.Workers.Scheduler.Start()
|
||||
_ = state.Workers.ClientAPI.Start(1, 10)
|
||||
_ = state.Workers.Federator.Start(1, 10)
|
||||
|
@ -52,11 +54,13 @@ func StartNoopWorkers(state *state.State) {
|
|||
|
||||
// Starts workers on the provided state using processing functions from the given
|
||||
// workers processor. Useful when you *do* want to trigger side effects in a test.
|
||||
func StartWorkers(state *state.State, wProcessor *wprocessor.Processor) {
|
||||
state.Workers.EnqueueClientAPI = wProcessor.EnqueueClientAPI
|
||||
state.Workers.EnqueueFediAPI = wProcessor.EnqueueFediAPI
|
||||
state.Workers.ProcessFromClientAPI = wProcessor.ProcessFromClientAPI
|
||||
state.Workers.ProcessFromFediAPI = wProcessor.ProcessFromFediAPI
|
||||
func StartWorkers(state *state.State, processor *workers.Processor) {
|
||||
state.Workers.EnqueueClientAPI = processor.EnqueueClientAPI
|
||||
state.Workers.EnqueueFediAPI = processor.EnqueueFediAPI
|
||||
state.Workers.ProcessFromClientAPI = processor.ProcessFromClientAPI
|
||||
state.Workers.ProcessFromFediAPI = processor.ProcessFromFediAPI
|
||||
|
||||
state.Workers.Delivery.Init(nil)
|
||||
|
||||
_ = state.Workers.Scheduler.Start()
|
||||
_ = state.Workers.ClientAPI.Start(1, 10)
|
||||
|
|
Loading…
Reference in a new issue