Skip to content

Commit

Permalink
Bumped version to 1.8.1, restructured the initial migration template …
Browse files Browse the repository at this point in the history
…and added fields for helder's code. Defaulted queue over to not deleting old jobs in the initializer. README has been updated to reflect changes.
  • Loading branch information
PatrickTulskie committed Jul 24, 2009
1 parent 8debc73 commit 5988b5b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
6 changes: 5 additions & 1 deletion README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ You can invoke @rake jobs:clear@ to delete all jobs in the queue. There are also

h3. Changes

* 1.8.1 Restructured the initial migration template, added fields for tracking jobs in queue, and defaulted the queue over to not purge completed jobs. Much of this code came from Helder's branch.

* 1.8.0: Version number was bumped by collectiveidea's fork. TODO Document specifically what's different.

* 1.7.0: Added failed_at column which can optionally be set after a certain amount of failed job attempts. By default failed job attempts are destroyed after about a month.

* 1.6.0: Renamed locked_until to locked_at. We now store when we start a given job instead of how long it will be locked by the worker. This allows us to get a reading on how long a job took to execute.
Expand All @@ -119,4 +123,4 @@ h3. Changes

h3. Why Is This Fork Different?

Patrick composed this of collectiveidea's fork and helder's fork because collective idea was more feature complete and helder had additional features I require.
Patrick composed this of collectiveidea's fork and helder's fork because collective idea was more feature complete and helder had additional features he requires.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.8.0
1.8.1
23 changes: 13 additions & 10 deletions generators/delayed_job/templates/migration.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
class CreateDelayedJobs < ActiveRecord::Migration
def self.up
create_table :delayed_jobs, :force => true do |table|
table.integer :priority, :default => 0 # Allows some jobs to jump to the front of the queue
table.integer :attempts, :default => 0 # Provides for retries, but still fail eventually.
table.text :handler # YAML-encoded string of the object that will do work
table.text :last_error # reason for last failure (See Note below)
table.datetime :run_at # When to run. Could be Time.now for immediately, or sometime in the future.
table.datetime :locked_at # Set when a client is working on this object
table.datetime :failed_at # Set when all retries have failed (actually, by default, the record is deleted instead)
table.string :locked_by # Who is working on this object (if locked)
table.timestamps
create_table :delayed_jobs, :force => true do |t|
t.integer :priority, :default => 0 # Allows some jobs to jump to the front of the queue
t.integer :attempts, :default => 0 # Provides for retries, but still fail eventually.
t.text :handler # YAML-encoded string of the object that will do work
t.text :last_error # reason for last failure (See Note below)
t.string :locked_by # Who is working on this object (if locked)
t.datetime :run_at # When to run. Could be Time.now for immediately, or sometime in the future.
t.datetime :locked_at # Set when a client is working on this object
t.datetime :failed_at # Set when all retries have failed (actually, by default, the record is deleted instead)
t.datetime :first_started_at # Needed for task tracking
t.datetime :last_started_at # Needed for task tracking
t.datetime :finished_at # Needed for when you are not deleting items from the table on completion
t.timestamps
end

end
Expand Down
1 change: 1 addition & 0 deletions init.rb
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
require File.dirname(__FILE__) + '/lib/delayed_job'
Delayed::Job.destroy_successful_jobs = false

0 comments on commit 5988b5b

Please sign in to comment.