mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
remove while-loop
This commit is contained in:
parent
bd5d7dff36
commit
2c75765a33
@ -11,12 +11,11 @@ export async function startValidateCommunities(timerInterval: number): Promise<v
|
||||
logger.info(
|
||||
`Federation: startValidateCommunities loop with an interval of ${timerInterval} ms...`,
|
||||
)
|
||||
while (true) {
|
||||
// better to use setTimeout twice than setInterval once -> see https://javascript.info/settimeout-setinterval
|
||||
setTimeout(function run() {
|
||||
validateCommunities()
|
||||
logger.debug(`Federation: loop starts sleeping...`)
|
||||
await sleep(timerInterval)
|
||||
logger.debug(`Federation: loop ends sleeping`)
|
||||
}
|
||||
setTimeout(run, timerInterval)
|
||||
}, timerInterval)
|
||||
}
|
||||
|
||||
export async function validateCommunities(): Promise<void> {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user