worker: NewServer: move config parameters to a new Config struct

We will have more parameters soon so let's make this prettier sooner rather
than later.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
Ondřej Budai 2022-03-03 14:37:21 +01:00 committed by Ondřej Budai
parent 9feb7b59d6
commit c1dc58eba4
5 changed files with 49 additions and 32 deletions

View file

@ -8,7 +8,6 @@ import (
"net/http"
"os"
"testing"
"time"
"github.com/stretchr/testify/require"
@ -26,7 +25,7 @@ import (
func newV2Server(t *testing.T, dir string) (*v2.Server, *worker.Server, context.CancelFunc) {
q, err := fsjobqueue.New(dir)
require.NoError(t, err)
workerServer := worker.NewServer(nil, q, "", time.Duration(0), "/api/worker/v1")
workerServer := worker.NewServer(nil, q, worker.Config{BasePath: "/api/worker/v1"})
distros, err := distro_mock.NewDefaultRegistry()
require.NoError(t, err)