Skip to content

Commit

Permalink
Change api of removeWorker to match other provider methods
Browse files Browse the repository at this point in the history
  • Loading branch information
imbstack committed Oct 4, 2019
1 parent b1cdbc3 commit a8f9e15
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion services/worker-manager/src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ builder.declare({
}

try {
await provider.removeWorker(worker);
await provider.removeWorker({worker});
} catch (err) {
if (!(err instanceof ApiError)) {
throw err;
Expand Down
2 changes: 1 addition & 1 deletion services/worker-manager/src/providers/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Provider {
throw new ApiError('not supported for this provider');
}

async removeWorker(worker) {
async removeWorker({worker}) {
throw new ApiError('not supported for this provider');
}

Expand Down
2 changes: 1 addition & 1 deletion services/worker-manager/src/providers/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class StaticProvider extends Provider {
return worker;
}

async removeWorker(worker) {
async removeWorker({worker}) {
await worker.remove();
}

Expand Down
2 changes: 1 addition & 1 deletion services/worker-manager/src/providers/testing.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class TestingProvider extends Provider {
return worker;
}

async removeWorker(worker) {
async removeWorker({worker}) {
if (!worker.providerData.allowRemoveWorker) {
throw new ApiError('removing workers is not supported for testing provider');
}
Expand Down

0 comments on commit a8f9e15

Please sign in to comment.