Skip to content

Commit

Permalink
* DM performance improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
lpetre committed Apr 7, 2010
1 parent e9b1573 commit 93833cc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/delayed/backend/data_mapper.rb
Expand Up @@ -30,9 +30,9 @@ class Job
property :id, Serial
property :priority, Integer, :default => 0, :index => :run_at_priority
property :attempts, Integer, :default => 0
property :handler, Text
property :handler, Text, :lazy => false
property :run_at, Time, :index => :run_at_priority
property :locked_at, Time
property :locked_at, Time, :index => true
property :locked_by, String
property :failed_at, Time
property :last_error, Text
Expand Down Expand Up @@ -69,6 +69,7 @@ def self.clear_locks!(worker_name)
# Lock this job for this worker.
# Returns true if we have the lock, false otherwise.
def lock_exclusively!(max_run_time, worker = worker_name)

now = self.class.db_time_now
overtime = now - max_run_time

Expand Down

0 comments on commit 93833cc

Please sign in to comment.