diff --git a/ij-server/src/main/kotlin/org/jetbrains/research/tasktracker/plugins/requests/FileRequests.kt b/ij-server/src/main/kotlin/org/jetbrains/research/tasktracker/plugins/requests/FileRequests.kt index 7da1ffc..65833ad 100644 --- a/ij-server/src/main/kotlin/org/jetbrains/research/tasktracker/plugins/requests/FileRequests.kt +++ b/ij-server/src/main/kotlin/org/jetbrains/research/tasktracker/plugins/requests/FileRequests.kt @@ -6,6 +6,8 @@ import io.ktor.server.plugins.* import io.ktor.server.response.* import io.ktor.server.routing.* import io.ktor.server.util.* +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Job import kotlinx.coroutines.launch import org.jetbrains.research.tasktracker.util.createLogFile import org.jetbrains.research.tasktracker.util.logFile.parseLogFile @@ -20,10 +22,10 @@ fun Routing.uploadLogFile() { val logFileType = parameters["logFileType"] ?: DEFAULT_FOLDER val researchId = parameters.getOrFail("id") val logFile = createLogFile(logFileType, researchId) - call.respond(HttpStatusCode.OK) - launch { + CoroutineScope(Job()).launch { logFile.parseLogFile(logFileType, researchId) } + call.respond(HttpStatusCode.OK) } catch (e: MissingRequestParameterException) { call.respond(HttpStatusCode.BadRequest, e.localizedMessage) } catch (e: ParameterConversionException) {