mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-19 21:33:21 +00:00
Merge pull request #1984 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
This commit is contained in:
commit
105d9743ae
2
.github/ISSUE_TEMPLATE/1.bug_report.yml
vendored
2
.github/ISSUE_TEMPLATE/1.bug_report.yml
vendored
|
@ -1,6 +1,6 @@
|
|||
name: Bug Report
|
||||
description: If something isn't working as expected
|
||||
labels: bug
|
||||
labels: [bug]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
|
|
2
.github/ISSUE_TEMPLATE/2.feature_request.yml
vendored
2
.github/ISSUE_TEMPLATE/2.feature_request.yml
vendored
|
@ -1,6 +1,6 @@
|
|||
name: Feature Request
|
||||
description: I have a suggestion
|
||||
labels: suggestion
|
||||
labels: [suggestion]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
|
|
|
@ -57,7 +57,7 @@ module Admin
|
|||
end
|
||||
|
||||
def preload_delivery_failures!
|
||||
warning_domains_map = DeliveryFailureTracker.warning_domains_map
|
||||
warning_domains_map = DeliveryFailureTracker.warning_domains_map(@instances.map(&:domain))
|
||||
|
||||
@instances.each do |instance|
|
||||
instance.failure_days = warning_domains_map[instance.domain]
|
||||
|
|
|
@ -65,8 +65,13 @@ class DeliveryFailureTracker
|
|||
domains - UnavailableDomain.all.pluck(:domain)
|
||||
end
|
||||
|
||||
def warning_domains_map
|
||||
warning_domains.index_with { |domain| redis.scard(exhausted_deliveries_key_by(domain)) }
|
||||
def warning_domains_map(domains = nil)
|
||||
if domains.nil?
|
||||
warning_domains.index_with { |domain| redis.scard(exhausted_deliveries_key_by(domain)) }
|
||||
else
|
||||
domains -= UnavailableDomain.where(domain: domains).pluck(:domain)
|
||||
domains.index_with { |domain| redis.scard(exhausted_deliveries_key_by(domain)) }.filter { |_, days| days.positive? }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Reference in a new issue