mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-01-03 05:53:07 +00:00
Enable http pipeline
This commit is contained in:
parent
f06b7ffcae
commit
e558fd8f94
@ -310,6 +310,7 @@ proc new*(
|
||||
initTAddress(config.apiBindAddress, config.apiPort),
|
||||
bufferSize = (1024 * 64),
|
||||
maxRequestBodySize = int.high,
|
||||
serverFlags = {HttpServerFlags.Http11Pipeline},
|
||||
)
|
||||
.expect("Should start rest server!")
|
||||
|
||||
|
||||
@ -24,7 +24,10 @@ const HttpClientTimeoutMs = 60 * 1000
|
||||
|
||||
proc new*(_: type CodexClient, baseurl: string): CodexClient =
|
||||
CodexClient(
|
||||
http: newHttpClient(timeout = HttpClientTimeoutMs),
|
||||
http: newHttpClient(
|
||||
timeout = HttpClientTimeoutMs,
|
||||
headers = newHttpHeaders({"Connection": "keep-alive"}),
|
||||
),
|
||||
baseurl: baseurl,
|
||||
session: HttpSessionRef.new({HttpClientFlag.Http11Pipeline}),
|
||||
)
|
||||
|
||||
@ -84,8 +84,6 @@ multinodesuite "Sales":
|
||||
until = until.some,
|
||||
)
|
||||
|
||||
host.restart()
|
||||
|
||||
let updatedAvailability = (host.getAvailabilities().get).findItem(availability).get
|
||||
check updatedAvailability.duration == 100.uint64
|
||||
check updatedAvailability.minPricePerBytePerSecond == 2
|
||||
@ -116,8 +114,6 @@ multinodesuite "Sales":
|
||||
).get
|
||||
host.patchAvailability(availability.id, totalSize = 100000.uint64.some)
|
||||
|
||||
host.restart()
|
||||
|
||||
let updatedAvailability = (host.getAvailabilities().get).findItem(availability).get
|
||||
check updatedAvailability.totalSize == 100000
|
||||
check updatedAvailability.freeSize == 100000
|
||||
@ -157,15 +153,11 @@ multinodesuite "Sales":
|
||||
let totalSizeResponse =
|
||||
host.patchAvailabilityRaw(availability.id, totalSize = (utilizedSize - 1).some)
|
||||
|
||||
host.restart()
|
||||
|
||||
check totalSizeResponse.status == "400 Bad Request"
|
||||
check "totalSize must be larger then current totalSize" in totalSizeResponse.body
|
||||
|
||||
host.patchAvailability(availability.id, totalSize = (originalSize + 20000).some)
|
||||
|
||||
host.restart()
|
||||
|
||||
let newUpdatedAvailability =
|
||||
(host.getAvailabilities().get).findItem(availability).get
|
||||
check newUpdatedAvailability.totalSize == originalSize + 20000
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user