Skip to content

Commit

Permalink
Merge pull request #186 from SwissDataScienceCenter/log-set-message-id
Browse files Browse the repository at this point in the history
Don't fail when the last message id cannot be set
  • Loading branch information
eikek authored Aug 14, 2024
2 parents 0057b87 + 62ed7be commit b18d594
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ object RedisQueueClient:
class RedisQueueClientImpl[F[_]: Async: Log](client: RedisClient)
extends RedisQueueClient[F] {

private val logger = scribe.cats.effect[F]

override def enqueue(
queueName: QueueName,
header: ByteVector,
Expand Down Expand Up @@ -125,7 +127,12 @@ class RedisQueueClientImpl[F[_]: Async: Log](client: RedisClient)
messageId: MessageId
): F[Unit] =
createStringCommands.use {
_.set(formProcessedKey(clientId, queueName), messageId)
_.set(formProcessedKey(clientId, queueName), messageId).recoverWith { case ex =>
logger.warn(
s"Error setting last message-id '$messageId' for '${formProcessedKey(clientId, queueName)}'",
ex
)
}
}

override def findLastProcessed(
Expand Down

0 comments on commit b18d594

Please sign in to comment.