diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-07-26 13:25:24 -0500 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-07-26 15:20:57 -0500 |
commit | 0151f14dbc1abf33e6bf5cf9bbd2e8038fa39740 (patch) | |
tree | 0362a9226de6aaf0da65289433ca69192159557a /app/helpers/autoreject_helper.rb | |
parent | e0b257d512708c8c4fc14af538501954070e0056 (diff) |
split federation & moderation logs into different subscopes + make scope tag prefix configurable
Diffstat (limited to 'app/helpers/autoreject_helper.rb')
-rw-r--r-- | app/helpers/autoreject_helper.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/helpers/autoreject_helper.rb b/app/helpers/autoreject_helper.rb index 6f010ca96..1e53f785f 100644 --- a/app/helpers/autoreject_helper.rb +++ b/app/helpers/autoreject_helper.rb @@ -1,4 +1,6 @@ module AutorejectHelper + LOG_SCOPE_FEDERATION = ENV.fetch('LOG_SCOPE_FEDERATION', 'federation') + def should_reject?(uri = nil) if uri.nil? if @object @@ -91,10 +93,10 @@ module AutorejectHelper reason = reject_reason(reason) if @json Rails.logger.info("Auto-rejected #{@json['id']} (#{@json['type']})") - LogWorker.perform_async("\xf0\x9f\x9a\xab Auto-rejected an incoming '#{@json['type']}#{@object && " #{@object['type']}".rstrip}' from #{@json['id']} because #{reason}.") + LogWorker.perform_async("\xf0\x9f\x9a\xab Auto-rejected an incoming '#{@json['type']}#{@object && " #{@object['type']}".rstrip}' from #{@json['id']} because #{reason}.", LOG_SCOPE_FEDERATION) elsif uri Rails.logger.info("Auto-rejected #{uri}") - LogWorker.perform_async("\xf0\x9f\x9a\xab Auto-rejected a request to #{uri} because #{reason}.") + LogWorker.perform_async("\xf0\x9f\x9a\xab Auto-rejected a request to #{uri} because #{reason}.", LOG_SCOPE_FEDERATION) end return true end |