1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2025-11-30 21:32:30 +00:00

style(rubocop): Lint/UselessAssignment

هذا الالتزام موجود في:
Adam Cooke
2024-02-10 17:16:45 +00:00
الأصل 25d7d66b47
التزام 7590a46234
12 ملفات معدلة مع 18 إضافات و20 حذوفات

عرض الملف

@@ -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