lib/taskinator/persistence.rb in taskinator-0.5.1 vs lib/taskinator/persistence.rb in taskinator-0.5.2
- old
+ new
@@ -113,17 +113,17 @@
process_key = self.process_key
conn.multi do |transaction|
transaction.hmset(
self.key,
:state, new_state,
- :updated_at, @updated_at
+ :updated_at, @updated_at.iso8601(3)
)
# also update the "root" process
transaction.hset(
process_key,
- :updated_at, @updated_at
+ :updated_at, @updated_at.iso8601(3)
)
end
end
new_state
end
@@ -136,11 +136,11 @@
conn.hmset(
self.key,
:error_type, error.class.name,
:error_message, error.message,
:error_backtrace, JSON.generate(error.backtrace || []),
- :updated_at, Time.now.utc
+ :updated_at, Time.now.utc.iso8601(3)
)
end
end
# retrieves the error type, message and backtrace
@@ -180,11 +180,11 @@
define_method "incr_#{status}" do
Taskinator.redis do |conn|
process_key = self.process_key
conn.multi do |transaction|
transaction.hincrby process_key, "tasks_#{status}", 1
- transaction.hset process_key, :updated_at, Time.now.utc
+ transaction.hset process_key, :updated_at, Time.now.utc.iso8601(3)
end
end
end
define_method "percentage_#{status}" do
@@ -292,10 +292,11 @@
value = @instance.send(attribute)
@hmset += [attribute, value] if value
end
def visit_attribute_time(attribute)
- visit_attribute(attribute)
+ value = @instance.send(attribute)
+ @hmset += [attribute, value.iso8601(3)] if value
end
def visit_attribute_enum(attribute, type)
visit_attribute(attribute)
end