Merge branch 'main' into glitch-soc/merge-upstream

This commit is contained in:
Claire
2021-05-22 13:11:31 +02:00
55 changed files with 646 additions and 418 deletions

View File

@@ -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