Download structure for all files in one go. For better UX

This commit is contained in:
Guntis Smaukstelis
2025-02-14 20:26:57 +02:00
parent 8bd5be413d
commit 0b221bcfee
6 changed files with 68 additions and 35 deletions
+7
View File
@@ -54,6 +54,13 @@ class DataService(log: Logger[IO]) {
}
}
def getAllFileStructure(): IO[List[Grib]] = {
for {
fileList <- getFileList()
allStructure <- fileList.traverse(getGribStucture)
} yield allStructure.flatten
}
def getBinaryChunk(offset: Int, length: Int, fileName: String): IO[Array[Byte]] = {
IO.blocking {
val source = Source.fromFile(s"$GRIB_FOLDER/$fileName", "ISO-8859-1")