Documentation in UpdateUserQueueService

This commit is contained in:
nise.moe 2024-02-22 15:29:55 +01:00
parent bebbfd6411
commit 4003dd81d4

View File

@ -72,6 +72,9 @@ class UpdateUserQueueService(
)
}
/**
* Retrieves the full update queue, only pending users.
*/
fun getQueue(): List<Long> {
return dslContext.select(UPDATE_USER_QUEUE.USER_ID)
.from(UPDATE_USER_QUEUE)
@ -99,6 +102,11 @@ class UpdateUserQueueService(
return insertedRows == 1
}
/**
* Sets the given user as processed in the update queue.
*
* @param userId The user ID of the user to set as processed.
*/
fun setUserAsProcessed(userId: Long) {
dslContext.update(UPDATE_USER_QUEUE)
.set(UPDATE_USER_QUEUE.PROCESSED, true)
@ -110,7 +118,7 @@ class UpdateUserQueueService(
// Notify the user that their queue has been processed with fresh info
messagingTemplate.convertAndSend(
"/topic/live-user/${userId}",
UpdateUserQueueService.UserQueueWebsocketPacket(message = "UPDATE_PROGRESS", data = this.getUserQueueDetails(userId))
UserQueueWebsocketPacket(message = "UPDATE_PROGRESS", data = this.getUserQueueDetails(userId))
)
}