Skip to content

Commit

Permalink
Merge pull request #313 from ivpn/task/increase-api-timeout
Browse files Browse the repository at this point in the history
Increase session API calls timeout
  • Loading branch information
jurajhilje authored Feb 2, 2024
2 parents 2363677 + f2c1726 commit d236229
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class SessionController @Inject constructor(
}

private fun innerCreateSession(body: SessionNewRequestBody, keys: Keypair?) {
sessionNewRequest = Request(settings, clientFactory, serversRepository, Request.Duration.SHORT, RequestWrapper.IpMode.IPv4)
sessionNewRequest = Request(settings, clientFactory, serversRepository, Request.Duration.LONG, RequestWrapper.IpMode.IPv4)

sessionNewRequest?.start({ api: IVPNApi -> api.newSession(body) },
object : RequestListener<SessionNewResponse> {
Expand Down Expand Up @@ -179,7 +179,7 @@ class SessionController @Inject constructor(

val token = userPreference.getSessionToken()
val requestBody = DeleteSessionRequestBody(token)
deleteSessionRequest = Request(settings, clientFactory, serversRepository, Request.Duration.SHORT, RequestWrapper.IpMode.IPv4)
deleteSessionRequest = Request(settings, clientFactory, serversRepository, Request.Duration.LONG, RequestWrapper.IpMode.IPv4)

deleteSessionRequest?.start({ api: IVPNApi -> api.deleteSession(requestBody) },
object : RequestListener<DeleteSessionResponse?> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class Request<T> {

public Request(Settings settings, HttpClientFactory httpClientFactory, ServersRepository serversRepository,
Duration duration, RequestWrapper.IpMode mode) {
int timeOut = duration == Duration.SHORT ? 10 : 30;
int timeOut = duration == Duration.SHORT ? 15 : 45;
requestWrapper = new RequestWrapper<T>(settings, httpClientFactory, serversRepository, timeOut, mode);
}

Expand Down

0 comments on commit d236229

Please sign in to comment.