Skip to content

Commit

Permalink
expired lock: throw error instead of logging (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdemare authored Sep 10, 2024
1 parent c185325 commit 336b240
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/nl/surf/eduhub_rio_mapper/worker.clj
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
lua-result (car/wcar redis-conn (car/lua lua-script {:k k} {:token token}))]
(assert (number? lua-result))
(when (not= 1 lua-result)
(log/error (str "Lock " k " lost before release!")))))
(throw (ex-info "Lock lost before release!" {:lock-name k})))))

(defn extend-lock!
"Extend TTL on lock on `queue` with `token` by `ttl-ms`.
Expand All @@ -80,7 +80,7 @@
lua-result (car/wcar redis-conn (car/lua lua-script {:k k} {:token token, :ttl-ms ttl-ms}))]
(assert (number? lua-result))
(when (not= 1 lua-result)
(log/error (str "Lock lost before extend!" {:lock-name k})))))
(throw (ex-info "Lock lost before extend!" {:lock-name k})))))

(defn- queue-key [config queue]
(prefix-key config (str "queue:" queue)))
Expand Down

0 comments on commit 336b240

Please sign in to comment.