about summary refs log tree commit diff
path: root/app/lib/activitypub
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2021-05-22 13:11:31 +0200
committerClaire <claire.github-309c@sitedethib.com>2021-05-22 13:11:31 +0200
commit5f334807d23146d58722d932442444238dbaa65d (patch)
treef6d41ae50ec7c1c56bffdbb808f94a45b1c4f167 /app/lib/activitypub
parent03952c7d4980a008f6711d7f14b8808229d73524 (diff)
parent92a9fcf0e139f2e7c99feb0f6d7f2b71064a5592 (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Diffstat (limited to 'app/lib/activitypub')
-rw-r--r--app/lib/activitypub/activity.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/lib/activitypub/activity.rb b/app/lib/activitypub/activity.rb
index 3baee4ca4..d2ec122a4 100644
--- a/app/lib/activitypub/activity.rb
+++ b/app/lib/activitypub/activity.rb
@@ -216,8 +216,8 @@ class ActivityPub::Activity
     redis.del(key)
   end
 
-  def lock_or_fail(key)
-    RedisLock.acquire({ redis: Redis.current, key: key }) do |lock|
+  def lock_or_fail(key, expire_after = 15.minutes.seconds)
+    RedisLock.acquire({ redis: Redis.current, key: key, autorelease: expire_after }) do |lock|
       if lock.acquired?
         yield
       else