Skip to content

Commit eb7c892

Browse files
committed
await assignment progress
1 parent ca748f2 commit eb7c892

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

dist/clean/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ async function assignIP() {
247247
const body = await res.json();
248248

249249
const expectedProgress = 100;
250-
const done = periodicExecution(
250+
const done = await periodicExecution(
251251
getAssignmentProgress(parsedIPId, body.action.id),
252252
expectedProgress,
253253
assignmentTimeout

dist/deploy/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ async function assignIP() {
252252
const body = await res.json();
253253

254254
const expectedProgress = 100;
255-
const done = periodicExecution(
255+
const done = await periodicExecution(
256256
getAssignmentProgress(parsedIPId, body.action.id),
257257
expectedProgress,
258258
assignmentTimeout

lib.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ async function assignIP() {
218218
const body = await res.json();
219219

220220
const expectedProgress = 100;
221-
const done = periodicExecution(
221+
const done = await periodicExecution(
222222
getAssignmentProgress(parsedIPId, body.action.id),
223223
expectedProgress,
224224
assignmentTimeout

test/index_test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ test("if assigning a floating IP to a server is possible", async t => {
234234
const floatingIP = "127.0.0.1";
235235
const SERVER_ID = 1234;
236236
const hcloudToken = "abc";
237+
const IPAssignmentTimeout = 10000;
237238

238239
const worker = await createWorker(`
239240
const actionId = 4321;
@@ -296,6 +297,8 @@ test("if assigning a floating IP to a server is possible", async t => {
296297
return floatingIPId;
297298
case "hcloud-token":
298299
return hcloudToken;
300+
case "floating-ip-assignment-timeout":
301+
return IPAssignmentTimeout;
299302
default:
300303
return "mock value";
301304
}

0 commit comments

Comments
 (0)