瀏覽代碼

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

* Spread out crawling randomly to avoid DDoSing the link

Fix #4486

* Remove trailing whitespace
master
Eugen Rochko 5 年之前
committed by GitHub
父節點
當前提交
b4ba4b1b5d
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: 4AEE18F83AFDEB23
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. +3
    -1
      app/lib/activitypub/activity.rb

+ 3
- 1
app/lib/activitypub/activity.rb 查看文件

@@ -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…
取消
儲存