A platform for community discussion. Free, open, simple.
FEATURE: allow post process mutex to be held longer
Sam Saffron67f5ad5ac038
diff --git a/lib/cooked_post_processor.rb b/lib/cooked_post_processor.rbindex a0c2efd93b2..ac16eb82c16 100644--- a/lib/cooked_post_processor.rb+++ b/lib/cooked_post_processor.rb@@ -35,7 +35,7 @@ class CookedPostProcessorenddef post_process(bypass_bump: false, new_post: false)- DistributedMutex.synchronize("post_process_#{@post.id}") do+ DistributedMutex.synchronize("post_process_#{@post.id}", validity: 10.minutes) doDiscourseEvent.trigger(:before_post_process_cooked, @doc, @post)remove_full_quote_on_direct_reply if new_postpost_process_oneboxesdiff --git a/lib/distributed_mutex.rb b/lib/distributed_mutex.rbindex 420c5bc1436..19f8b5dd4bc 100644--- a/lib/distributed_mutex.rb+++ b/lib/distributed_mutex.rb@@ -31,11 +31,11 @@ class DistributedMutexyieldensurecurrent_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_timewarn("didn't unlock cleanly")endend