Formatting in BackgroundScope

This commit is contained in:
Xiaro 2021-03-06 00:50:48 -05:00 committed by GitHub
parent 49b915828a
commit 72938e730d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -20,12 +20,13 @@ internal object BackgroundScope : CoroutineScope by CoroutineScope(newFixedThrea
return launchLooping(BackgroundJob(name, delay, block))
}
fun launchLooping(job: BackgroundJob) : BackgroundJob {
fun launchLooping(job: BackgroundJob): BackgroundJob {
if (!started) {
jobs[job] = null
} else {
jobs[job] = startJob(job)
}
return job
}
@ -44,4 +45,4 @@ internal object BackgroundScope : CoroutineScope by CoroutineScope(newFixedThrea
}
}
}
}