jobqueue: introduce the concept of channels
Channels are a concept similar to job types. Callers must specify a channel name when queueing a new job. A list of channels is also specified when dequeueing a job. The dequeued job's channel will always be from one of the specified channel. Of course, the job types are also respected. The dequeued job will also always be from one of the specified type. Currently, all calls to jobqueue were changed so all queue operations use an empty channel name and all dequeue operations use a list containing an empty channel. Thus, this is a non-functional change. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
parent
ba4f49078a
commit
7bfcee36f8
15 changed files with 202 additions and 176 deletions
|
|
@ -39,7 +39,7 @@ func newV2Server(t *testing.T, dir string) (*v2.Server, *worker.Server, context.
|
|||
depsolveContext, cancel := context.WithCancel(context.Background())
|
||||
go func() {
|
||||
for {
|
||||
_, token, _, _, _, err := workerServer.RequestJob(context.Background(), test_distro.TestDistroName, []string{"depsolve"})
|
||||
_, token, _, _, _, err := workerServer.RequestJob(context.Background(), test_distro.TestDistroName, []string{"depsolve"}, []string{""})
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
|
@ -575,7 +575,7 @@ func TestComposeStatusSuccess(t *testing.T) {
|
|||
"kind": "ComposeId"
|
||||
}`, "id")
|
||||
|
||||
jobId, token, jobType, args, dynArgs, err := wrksrv.RequestJob(context.Background(), test_distro.TestArch3Name, []string{"osbuild"})
|
||||
jobId, token, jobType, args, dynArgs, err := wrksrv.RequestJob(context.Background(), test_distro.TestArch3Name, []string{"osbuild"}, []string{""})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, "osbuild", jobType)
|
||||
|
||||
|
|
@ -647,7 +647,7 @@ func TestComposeStatusFailure(t *testing.T) {
|
|||
"kind": "ComposeId"
|
||||
}`, "id")
|
||||
|
||||
jobId, token, jobType, _, _, err := wrksrv.RequestJob(context.Background(), test_distro.TestArch3Name, []string{"osbuild"})
|
||||
jobId, token, jobType, _, _, err := wrksrv.RequestJob(context.Background(), test_distro.TestArch3Name, []string{"osbuild"}, []string{""})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, "osbuild", jobType)
|
||||
|
||||
|
|
@ -699,7 +699,7 @@ func TestComposeLegacyError(t *testing.T) {
|
|||
"kind": "ComposeId"
|
||||
}`, "id")
|
||||
|
||||
jobId, token, jobType, _, _, err := wrksrv.RequestJob(context.Background(), test_distro.TestArch3Name, []string{"osbuild"})
|
||||
jobId, token, jobType, _, _, err := wrksrv.RequestJob(context.Background(), test_distro.TestArch3Name, []string{"osbuild"}, []string{""})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, "osbuild", jobType)
|
||||
|
||||
|
|
@ -754,7 +754,7 @@ func TestComposeJobError(t *testing.T) {
|
|||
"kind": "ComposeId"
|
||||
}`, "id")
|
||||
|
||||
jobId, token, jobType, _, _, err := wrksrv.RequestJob(context.Background(), test_distro.TestArch3Name, []string{"osbuild"})
|
||||
jobId, token, jobType, _, _, err := wrksrv.RequestJob(context.Background(), test_distro.TestArch3Name, []string{"osbuild"}, []string{""})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, "osbuild", jobType)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue