مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2025-12-01 05:43:04 +00:00
ensure all timestamps from the message DB go through a zone
هذا الالتزام موجود في:
@@ -22,5 +22,5 @@
|
||||
%p.suppressionList__address= link_to suppression['address'], outgoing_organization_server_messages_path(organization, @server, :query => "to: #{suppression['address']}")
|
||||
%p.suppressionList__reason= suppression['reason'].capitalize
|
||||
.suppressionList__right
|
||||
%p.suppressionList__timestamp Added #{Time.at(suppression['timestamp']).to_s(:long)}
|
||||
%p.suppressionList__timestamp Added #{Time.zone.at(suppression['timestamp']).to_s(:long)}
|
||||
= render 'shared/message_db_pagination', :data => @suppressions, :name => "suppression"
|
||||
|
||||
@@ -6,7 +6,7 @@ module Postal
|
||||
@url = link['url']
|
||||
@ip_address = attributes['ip_address']
|
||||
@user_agent = attributes['user_agent']
|
||||
@timestamp = Time.at(attributes['timestamp'])
|
||||
@timestamp = Time.zone.at(attributes['timestamp'])
|
||||
end
|
||||
|
||||
attr_reader :ip_address
|
||||
|
||||
@@ -26,7 +26,7 @@ module Postal
|
||||
end
|
||||
|
||||
def timestamp
|
||||
@timestamp ||= @attributes['timestamp'] ? Time.at(@attributes['timestamp']) : nil
|
||||
@timestamp ||= @attributes['timestamp'] ? Time.zone.at(@attributes['timestamp']) : nil
|
||||
end
|
||||
|
||||
def update_statistics
|
||||
|
||||
@@ -5,7 +5,7 @@ module Postal
|
||||
def initialize(attributes)
|
||||
@ip_address = attributes['ip_address']
|
||||
@user_agent = attributes['user_agent']
|
||||
@timestamp = Time.at(attributes['timestamp'])
|
||||
@timestamp = Time.zone.at(attributes['timestamp'])
|
||||
end
|
||||
|
||||
attr_reader :ip_address
|
||||
|
||||
@@ -97,21 +97,21 @@ module Postal
|
||||
# Return the timestamp for this message
|
||||
#
|
||||
def timestamp
|
||||
@timestamp ||= @attributes['timestamp'] ? Time.at(@attributes['timestamp']) : nil
|
||||
@timestamp ||= @attributes['timestamp'] ? Time.zone.at(@attributes['timestamp']) : nil
|
||||
end
|
||||
|
||||
#
|
||||
# Return the time that the last delivery was attempted
|
||||
#
|
||||
def last_delivery_attempt
|
||||
@last_delivery_attempt ||= @attributes['last_delivery_attempt'] ? Time.at(@attributes['last_delivery_attempt']) : nil
|
||||
@last_delivery_attempt ||= @attributes['last_delivery_attempt'] ? Time.zone.at(@attributes['last_delivery_attempt']) : nil
|
||||
end
|
||||
|
||||
#
|
||||
# Return the hold expiry for this message
|
||||
#
|
||||
def hold_expiry
|
||||
@hold_expiry ||= @attributes['hold_expiry'] ? Time.at(@attributes['hold_expiry']) : nil
|
||||
@hold_expiry ||= @attributes['hold_expiry'] ? Time.zone.at(@attributes['hold_expiry']) : nil
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
@@ -45,7 +45,7 @@ module Postal
|
||||
end
|
||||
end
|
||||
@database.select("stats_#{type}", :where => {:time => items.keys.map(&:to_i)}, :fields => [:time] | counters).each do |data|
|
||||
time = Time.at(data.delete('time'))
|
||||
time = Time.zone.at(data.delete('time'))
|
||||
data.each do |key, value|
|
||||
items[time][key.to_sym] = value
|
||||
end
|
||||
|
||||
@@ -40,7 +40,7 @@ module Postal
|
||||
end
|
||||
|
||||
def timestamp
|
||||
Time.at(@attributes['timestamp'])
|
||||
Time.zone.at(@attributes['timestamp'])
|
||||
end
|
||||
|
||||
def event
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم