Skip to content

Commit cc7044b

Browse files
committed
Ajudjust workload.routing values
1 parent 821e4e7 commit cc7044b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/benchkit-backend/src/workload.validator.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,13 @@ export async function validate (workload) {
1313
throw new BadRequestError(`workload.mode="${workload.mode}" can not be used with workload.method="${workload.method}"`)
1414
}
1515

16+
workload.routing = workload.routing || 'write'
17+
18+
if (workload.routing !== 'read' && workload.routing !== 'write') {
19+
throw new BadRequestError(`workload.routing="${workload.mode}" while expected "read" or "write"`)
20+
}
21+
22+
workload.routing = workload.routing.toUpperCase()
23+
1624
return workload
1725
}

0 commit comments

Comments
 (0)