mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 03:41:12 +08:00
FEATURE: allow post process mutex to be held longer
Previously we would only hold the post process mutex for 1 minute, that is not enough when processing a post with lots of images. This raises the bar to 10 minutes. It also cleans up error reporting around distributed mutexes expiring. We used to double report.
This commit is contained in:
@ -31,11 +31,11 @@ class DistributedMutex
|
||||
yield
|
||||
ensure
|
||||
current_time = redis.time[0]
|
||||
unless current_time < expire_time
|
||||
warn("held for too long")
|
||||
if current_time > expire_time
|
||||
warn("held for too long, expected max: #{@validity} secs, took an extra #{current_time - expire_time} secs")
|
||||
end
|
||||
|
||||
unless unlock(expire_time)
|
||||
if !unlock(expire_time) && current_time <= expire_time
|
||||
warn("didn't unlock cleanly")
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user