diff options
author | Claire <claire.github-309c@sitedethib.com> | 2021-05-22 15:16:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-22 15:16:21 +0200 |
commit | 2024aef0f9b52297d814811f5825678a563f78ff (patch) | |
tree | 5014b9fa72ae4704d61ae7ffc8e992f0b67b6a25 /app/lib | |
parent | 03952c7d4980a008f6711d7f14b8808229d73524 (diff) | |
parent | 8027d921ab174b35bcf08bf96b69676a4515435f (diff) |
Merge pull request #1542 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/activitypub/activity.rb | 4 |
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 |