修复串行执行任务

pin
wmzh2006 2 years ago
parent c5eaded243
commit 38c9947e92

@ -107,14 +107,21 @@ 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, context).runTask( TaskExecService(
task,
taskResponse,
userId,
context
).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