Skip to content

Commit 52e86db

Browse files
committed
Some refactor
1 parent 5c4f9a8 commit 52e86db

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lambda-runtime/src/commonMain/kotlin/io/github/trueangle/knative/lambda/runtime/LambdaRuntime.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ object LambdaRuntime {
6363

6464
with(Log) {
6565
setContext(context)
66+
6667
trace(event)
6768
trace(context)
6869
}
@@ -83,6 +84,7 @@ object LambdaRuntime {
8384
when (e) {
8485
is NonRecoverableStateException -> {
8586
Log.fatal(e)
87+
8688
exitProcess(1)
8789
}
8890

lambda-runtime/src/commonMain/kotlin/io/github/trueangle/knative/lambda/runtime/api/LambdaRuntimeClient.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import io.ktor.http.contentType
2424
import io.ktor.util.reflect.TypeInfo
2525
import kotlinx.serialization.json.Json
2626
import kotlin.time.Duration.Companion.minutes
27-
import kotlin.time.TimeSource
2827
import io.ktor.http.ContentType.Application.Json as ContentTypeJson
2928

3029
@PublishedApi
@@ -34,9 +33,8 @@ internal class LambdaClient(private val httpClient: HttpClient) {
3433
suspend fun <T> retrieveNextEvent(bodyType: TypeInfo): Pair<T, Context> {
3534
val response = httpClient.get {
3635
url("${invokeUrl}/invocation/next")
37-
timeout {
38-
requestTimeoutMillis = 60 * 1000 * 30 // todo
39-
}
36+
37+
timeout { requestTimeoutMillis = 15.minutes.inWholeMilliseconds }
4038
}
4139
val context = contextFromResponseHeaders(response)
4240
val body = try {
@@ -72,7 +70,7 @@ internal class LambdaClient(private val httpClient: HttpClient) {
7270
url("${invokeUrl}/invocation/${event.awsRequestId}/response")
7371

7472
timeout {
75-
requestTimeoutMillis = 30.minutes.inWholeMilliseconds // todo
73+
requestTimeoutMillis = 15.minutes.inWholeMilliseconds
7674
}
7775

7876
headers {

0 commit comments

Comments
 (0)