Faster downloading grib files

This commit is contained in:
Guntis Smaukstelis
2025-07-11 11:12:06 +03:00
parent 26b31007bf
commit d621c2c89a
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -78,7 +78,7 @@ class DataService(log: Logger[IO]) {
private val semaphore = Semaphore[IO](4).unsafeRunSync() private val semaphore = Semaphore[IO](4).unsafeRunSync()
private val blockingEC = ExecutionContext.fromExecutorService( private val blockingEC = ExecutionContext.fromExecutorService(
Executors.newFixedThreadPool(4) // limit concurrency Executors.newFixedThreadPool(8) // limit concurrency
) )
def getBinaryChunk(offset: Int, length: Int, fileName: String): IO[Array[Byte]] = { def getBinaryChunk(offset: Int, length: Int, fileName: String): IO[Array[Byte]] = {
+1 -1
View File
@@ -21,7 +21,7 @@ async function processPromises<T>(
export async function processPromisesInBatches<T>( export async function processPromisesInBatches<T>(
promiseFns: (() => Promise<T>)[], promiseFns: (() => Promise<T>)[],
onProgress: (result: T) => void, onProgress: (result: T) => void,
batchSize = 3, batchSize = 10,
): Promise<(T | undefined)[]> { ): Promise<(T | undefined)[]> {
const results = [] const results = []
while(await promiseFns.length > 0) { while(await promiseFns.length > 0) {