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

Conflicts:
- `app/javascript/packs/public.js`:
  Upstream modified code that we split between multiple files due
  to glitch-soc's theming system.
  Ported those changes.
This commit is contained in:
Thibaut Girka
2020-04-05 18:32:06 +02:00
70 changed files with 1316 additions and 226 deletions

View File

@@ -7,6 +7,10 @@ class EntityCache
MAX_EXPIRATION = 7.days.freeze
def status(url)
Rails.cache.fetch(to_key(:status, url), expires_in: MAX_EXPIRATION) { FetchRemoteStatusService.new.call(url) }
end
def mention(username, domain)
Rails.cache.fetch(to_key(:mention, username, domain), expires_in: MAX_EXPIRATION) { Account.select(:id, :username, :domain, :url).find_remote(username, domain) }
end

View File

@@ -14,9 +14,9 @@ class RateLimiter
period: 3.hours.freeze,
}.freeze,
media: {
limit: 30,
period: 30.minutes.freeze,
reports: {
limit: 400,
period: 24.hours.freeze,
}.freeze,
}.freeze