Skip to content

Commit

Permalink
move run blocking
Browse files Browse the repository at this point in the history
  • Loading branch information
nullpointer0x00 committed Oct 2, 2024
1 parent c108d5e commit 8dc6c58
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -446,14 +446,12 @@ class ScheduledTaskService(
fun processAccountRecords() {
ProcessQueueRecord.reset(ProcessQueueType.ACCOUNT)
val records = ProcessQueueRecord.findByType(ProcessQueueType.ACCOUNT)
runBlocking {
for (record in records) {
try {
transaction { record.apply { this.processing = true } }
accountService.updateTokenCounts(record.processValue)
ProcessQueueRecord.delete(ProcessQueueType.ACCOUNT, record.processValue)
} catch (_: Exception) {
}
for (record in records) {
try {
transaction { record.apply { this.processing = true } }
runBlocking { accountService.updateTokenCounts(record.processValue) }
ProcessQueueRecord.delete(ProcessQueueType.ACCOUNT, record.processValue)
} catch (_: Exception) {
}
}
}
Expand Down

0 comments on commit 8dc6c58

Please sign in to comment.