now its not infinite
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2020-10-22 20:32:54 +02:00
parent 9663660519
commit 567f8a8d24
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047

View File

@ -16,6 +16,7 @@ fun main(args: Array<String>): Unit = io.ktor.server.tomcat.EngineMain.main(args
fun Application.module(testing: Boolean = false) {
runBlocking {
var startTime: Instant
var currTimeStamp: Instant
var elapsed = Duration.ZERO
val targetTime = Duration.ofSeconds(System.getenv("WAITTIME").toLong())
var currIter = 0
@ -29,6 +30,8 @@ fun Application.module(testing: Boolean = false) {
while (elapsed < targetTime) {
currIter += 1
uploaders.add(Uploader(currIter))
currTimeStamp = Instant.now()
elapsed = Duration.between(startTime, currTimeStamp)
}
for (uploader in uploaders) {
uploader.sendRequest()