|
|
@ -129,4 +129,10 @@ class ActivityPub::Activity |
|
|
|
::FetchRemoteStatusService.new.call(@object['url']) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
def lock_or_return(key, expire_after = 7.days.seconds) |
|
|
|
yield if redis.set(key, true, nx: true, ex: expire_after) |
|
|
|
ensure |
|
|
|
redis.del(key) |
|
|
|
end |
|
|
|
end |