Faster downloading grib files
This commit is contained in:
@@ -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]] = {
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user