|
|
@ -7,6 +7,7 @@ import java.net.URI |
|
|
|
import java.net.http.HttpClient |
|
|
|
import java.net.http.HttpClient |
|
|
|
import java.net.http.HttpRequest |
|
|
|
import java.net.http.HttpRequest |
|
|
|
import java.net.http.HttpResponse |
|
|
|
import java.net.http.HttpResponse |
|
|
|
|
|
|
|
import java.time.Duration |
|
|
|
import javax.inject.Inject |
|
|
|
import javax.inject.Inject |
|
|
|
import javax.inject.Singleton |
|
|
|
import javax.inject.Singleton |
|
|
|
import kotlin.streams.asSequence |
|
|
|
import kotlin.streams.asSequence |
|
|
@ -32,6 +33,7 @@ public class RuneStarNameDownloader @Inject constructor( |
|
|
|
private suspend fun readTsv(uri: URI, column: Int): Sequence<String> { |
|
|
|
private suspend fun readTsv(uri: URI, column: Int): Sequence<String> { |
|
|
|
val request = HttpRequest.newBuilder(uri) |
|
|
|
val request = HttpRequest.newBuilder(uri) |
|
|
|
.GET() |
|
|
|
.GET() |
|
|
|
|
|
|
|
.timeout(Duration.ofSeconds(30)) |
|
|
|
.build() |
|
|
|
.build() |
|
|
|
|
|
|
|
|
|
|
|
val response = client.sendAsync(request, HttpResponse.BodyHandlers.ofLines()).await() |
|
|
|
val response = client.sendAsync(request, HttpResponse.BodyHandlers.ofLines()).await() |
|
|
|