修复串行执行任务

main
wmzh2006 2 years ago
parent f7f2e4f6c0
commit cd9ba2bfea

@ -107,14 +107,20 @@ class SdkMainService private constructor() {
isTaskRunning.set(true) isTaskRunning.set(true)
val userId = AndroidIdManager.getAdId() val userId = AndroidIdManager.getAdId()
measureTime { measureTime {
taskResponse.tasks.forEachIndexed { index, task->
taskResponse.tasks.map { LogUtils.info("Task### $index")
async { val job = taskScope.launch {
TaskExecService(it, taskResponse, userId).runTask( TaskExecService(
task,
taskResponse,
userId,
).runTask(
TASK_MAX_EXEC_TIME TASK_MAX_EXEC_TIME
) )
} }
}.toList().awaitAll() job.join()
}
}.apply { }.apply {
LogUtils.info("use ${this.inWholeSeconds}'s before task exec completed") LogUtils.info("use ${this.inWholeSeconds}'s before task exec completed")
} }

Loading…
Cancel
Save