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

ensure all timestamps from the message DB go through a zone

هذا الالتزام موجود في:
Adam Cooke
2017-06-02 15:36:12 +01:00
الأصل 6e009f16b9
التزام 6f29bc8d3f
7 ملفات معدلة مع 9 إضافات و9 حذوفات

عرض الملف

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