Download structure for all files in one go. For better UX
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user