public
Description: Database based asynchronously priority queue system -- Extracted from Shopify
Homepage: http://www.shopify.com
Clone URL: git://github.com/tobi/delayed_job.git
Fix spelling mistake
Tobias Lütke (author)
Fri Jun 20 23:36:26 -0700 2008
commit  c689bf431ddb67bf9f87548f888cb288c4cad3a9
tree    5371b21cb615607bbbf366b4be6123c0fcdcf774
parent  b9dc92b9ca14e7cf2ec892c3ca3a1cb006989838
...
70
71
72
73
 
74
75
76
...
70
71
72
 
73
74
75
76
0
@@ -70,7 +70,7 @@ At Shopify we run the the tasks from a simple script/job_runner which is being i
0
   trap('TERM') { puts 'Exiting...'; $exit = true }
0
   trap('INT') { puts 'Exiting...'; $exit = true }
0
   
0
- puts "*** Staring job worker #{Delayed::Job.worker_name}"
0
+ puts "*** Starting job worker #{Delayed::Job.worker_name}"
0
   
0
   begin
0
   
...
30
31
32
33
 
34
35
36
...
50
51
52
53
 
 
 
54
55
56
...
30
31
32
 
33
34
35
36
...
50
51
52
 
53
54
55
56
57
58
0
@@ -30,7 +30,7 @@ module Delayed
0
     end
0
   
0
     def reshedule(message, time = nil)
0
- time ||= Job.db_time_now + (attempts ** 4).seconds + 1
0
+ time ||= Job.db_time_now + (attempts ** 4).seconds + 5
0
       
0
       self.attempts += 1
0
       self.run_at = time
0
@@ -50,7 +50,9 @@ module Delayed
0
     
0
     def self.find_available(limit = 5)
0
       time_now = db_time_now
0
- find(:all, :conditions => [NextTaskSQL, time_now, time_now, worker_name], :order => NextTaskOrder, :limit => 5)
0
+ ActiveRecord::Base.silence do
0
+ find(:all, :conditions => [NextTaskSQL, time_now, time_now, worker_name], :order => NextTaskOrder, :limit => limit)
0
+ end
0
     end
0
                                                                              
0
     # Get the payload of the next job we can get an exclusive lock on.
...
3
4
5
6
 
7
8
9
...
3
4
5
 
6
7
8
9
0
@@ -3,7 +3,7 @@ namespace :jobs do
0
                
0
   task :work => :environment do
0
 
0
- puts "*** Staring job worker #{Delayed::Job.worker_name}"
0
+ puts "*** Starting job worker #{Delayed::Job.worker_name}"
0
     
0
     SLEEP = 5
0
      

Comments

    No one has commented yet.