Style fix in UpdateUserQueueService
This commit is contained in:
parent
2d3b7b0817
commit
f3d8b69166
@ -2,10 +2,8 @@ package com.nisemoe.nise.service
|
||||
|
||||
import com.nisemoe.generated.tables.records.UpdateUserQueueRecord
|
||||
import com.nisemoe.generated.tables.references.UPDATE_USER_QUEUE
|
||||
import com.nisemoe.generated.tables.references.USERS
|
||||
import com.nisemoe.nise.UserQueueDetails
|
||||
import org.jooq.DSLContext
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.messaging.simp.SimpMessagingTemplate
|
||||
import org.springframework.stereotype.Service
|
||||
import java.time.Duration
|
||||
@ -18,7 +16,11 @@ class UpdateUserQueueService(
|
||||
private val messagingTemplate: SimpMessagingTemplate
|
||||
) {
|
||||
|
||||
private val USER_UPDATE_INTERVAL_HOURS = 4
|
||||
companion object {
|
||||
|
||||
const val USER_UPDATE_INTERVAL_HOURS = 4
|
||||
|
||||
}
|
||||
|
||||
data class UserQueueWebsocketPacket(
|
||||
val message: String,
|
||||
@ -44,7 +46,7 @@ class UpdateUserQueueService(
|
||||
.limit(1)
|
||||
.fetchOneInto(OffsetDateTime::class.java)
|
||||
|
||||
var canUpdate = !isProcessing;
|
||||
var canUpdate = !isProcessing
|
||||
if (lastCompletedUpdateQueue != null) {
|
||||
val now = OffsetDateTime.now(ZoneOffset.UTC)
|
||||
val duration = Duration.between(lastCompletedUpdateQueue, now)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user