Skip to content

Commit

Permalink
fix(redis): don't use transactions because dynomite (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
emjburns authored Oct 31, 2018
1 parent 5e7d2b6 commit 7a63ae2
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ class RedisResourceUseTrackingRepository(
override fun recordUse(resourceIdentifier: String, usedByResourceIdentifier: String) {
val now = clock.instant().toEpochMilli()

redisClientDelegate.withTransaction { tx ->
tx.hset(
redisClientDelegate.withCommandsClient { client ->
client.hset(
LAST_SEEN,
resourceIdentifier,
objectMapper.writeValueAsString(
Expand All @@ -75,8 +75,7 @@ class RedisResourceUseTrackingRepository(
// add to sorted set by score
// score = last_seen timestamp
// if resource is seen in next X days, resource will be updated
tx.zadd(LAST_SEEN_INDEX, now.toDouble(), resourceIdentifier)
tx.exec()
client.zadd(LAST_SEEN_INDEX, now.toDouble(), resourceIdentifier)
}
}

Expand Down

0 comments on commit 7a63ae2

Please sign in to comment.