Skip to content

Commit 5d01c6d

Browse files
Accept HTTP 201 for worker registration
1 parent 338ae45 commit 5d01c6d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/V2/Worker/WorkerProtocolClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function registerWorker(
131131
$body['max_concurrent_activity_tasks'] = $maxConcurrentActivityTasks;
132132
}
133133

134-
$response = $this->workerPost($this->workerApiPath.'/register', $body);
134+
$response = $this->workerPost($this->workerApiPath.'/register', $body, allowedStatuses: [200, 201]);
135135

136136
$this->registeredWorkerId = $workerId;
137137
$this->registeredTaskQueue = $taskQueue;

tests/Unit/V2/WorkerProtocolClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testRegisterWorkerSendsWorkerProtocolHeadersAndBody(): void
3434
),
3535
];
3636

37-
return $http->response(['ok' => true, 'heartbeat_interval_seconds' => 60]);
37+
return $http->response(['ok' => true, 'heartbeat_interval_seconds' => 60], 201);
3838
});
3939

4040
$client = new WorkerProtocolClient($http, 'http://server:8080/', 'test-token', 'default');

0 commit comments

Comments
 (0)