Browse Source

Spread out crawling randomly to avoid DDoSing the link (#8445)

* Spread out crawling randomly to avoid DDoSing the link

Fix #4486

* Remove trailing whitespace
pull/4/head
Eugen Rochko 5 years ago
committed by GitHub
parent
commit
b4ba4b1b5d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      app/lib/activitypub/activity.rb

+ 3
- 1
app/lib/activitypub/activity.rb View File

@ -104,7 +104,9 @@ class ActivityPub::Activity
def crawl_links(status)
return if status.spoiler_text?
LinkCrawlWorker.perform_async(status.id)
# Spread out crawling randomly to avoid DDoSing the link
LinkCrawlWorker.perform_in(rand(1..59).seconds, status.id)
end
def distribute_to_followers(status)

Loading…
Cancel
Save