مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2025-11-30 21:32:30 +00:00
style(rubocop): Lint/UselessAssignment
هذا الالتزام موجود في:
@@ -26,7 +26,7 @@ module Postal
|
||||
message
|
||||
end
|
||||
n.notify!(short_message: message_without_ansi, log_name: @log_name, facility: "postal", application_name: "postal", process_name: ENV.fetch("PROC_NAME", nil), pid: Process.pid)
|
||||
rescue StandardError => e
|
||||
rescue StandardError
|
||||
# Can't log this to GELF. Soz.
|
||||
end
|
||||
end
|
||||
|
||||
@@ -64,29 +64,29 @@ module Postal
|
||||
code: result.code.to_i,
|
||||
body: result.body,
|
||||
headers: result.to_hash,
|
||||
secure: @ssl
|
||||
secure: ssl
|
||||
}
|
||||
end
|
||||
rescue OpenSSL::SSL::SSLError => e
|
||||
rescue OpenSSL::SSL::SSLError
|
||||
{
|
||||
code: -3,
|
||||
body: "Invalid SSL certificate",
|
||||
headers: {},
|
||||
secure: @ssl
|
||||
secure: ssl
|
||||
}
|
||||
rescue SocketError, Errno::ECONNRESET, EOFError, Errno::EINVAL, Errno::ENETUNREACH, Errno::EHOSTUNREACH, Errno::ECONNREFUSED => e
|
||||
{
|
||||
code: -2,
|
||||
body: e.message,
|
||||
headers: {},
|
||||
secure: @ssl
|
||||
secure: ssl
|
||||
}
|
||||
rescue Timeout::Error => e
|
||||
rescue Timeout::Error
|
||||
{
|
||||
code: -1,
|
||||
body: "Timed out after #{timeout}s",
|
||||
headers: {},
|
||||
secure: @ssl
|
||||
secure: ssl
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -40,7 +40,7 @@ module Postal
|
||||
# Get a statistic (or statistics)
|
||||
#
|
||||
def get(type, counters, start_date = Time.now, quantity = 10)
|
||||
date = start_date.utc
|
||||
start_date = start_date.utc
|
||||
items = quantity.times.each_with_object({}) do |i, hash|
|
||||
hash[(start_date - i.send(STATS_GAPS[type])).send("beginning_of_#{STATS_GAPS[type]}").utc] = counters.each_with_object({}) do |c, h|
|
||||
h[c] = 0
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم