Skip to content

Commit 6d510a5

Browse files
committed
Destroy recurring execution when deleting a job
For example, if we don't keep finished jobs around.
1 parent a28ccda commit 6d510a5

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

app/models/solid_queue/job.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module SolidQueue
44
class Job < Record
5-
include Executable, Recurrable, Clearable
5+
include Executable, Clearable, Recurrable
66

77
serialize :arguments, coder: JSON
88

app/models/solid_queue/job/recurrable.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,8 @@ module Recurrable
66
extend ActiveSupport::Concern
77

88
included do
9-
has_one :recurring_execution
9+
has_one :recurring_execution, dependent: :destroy
1010
end
11-
12-
private
13-
def execution
14-
super || recurring_execution
15-
end
1611
end
1712
end
1813
end

0 commit comments

Comments
 (0)