Skip to content

Commit

Permalink
Fixed redis usage
Browse files Browse the repository at this point in the history
  • Loading branch information
epoberezhny committed Sep 10, 2024
1 parent a81d4c4 commit f732dee
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/taskinator/persistence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ def persist_workflow_state(new_state)
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
Expand All @@ -138,7 +138,7 @@ def fail(error=nil)
: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
Expand Down Expand Up @@ -182,7 +182,7 @@ def tasks_count
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
Expand Down Expand Up @@ -294,7 +294,8 @@ def visit_attribute(attribute)
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)
Expand Down

0 comments on commit f732dee

Please sign in to comment.