Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions lib/solid_queue/processes/registrable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,19 @@ def process_id
attr_accessor :process

def register
@process = SolidQueue::Process.register \
kind: kind,
name: name,
pid: pid,
hostname: hostname,
supervisor: try(:supervisor),
metadata: metadata.compact
wrap_in_app_executor do
@process = SolidQueue::Process.register \
kind: kind,
name: name,
pid: pid,
hostname: hostname,
supervisor: try(:supervisor),
metadata: metadata.compact
end
end

def deregister
process&.deregister
wrap_in_app_executor { process&.deregister }
end

def registered?
Expand Down
2 changes: 1 addition & 1 deletion lib/solid_queue/scheduler/recurring_schedule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def persist_tasks
end

def reload_tasks
@configured_tasks = SolidQueue::RecurringTask.where(key: task_keys)
@configured_tasks = SolidQueue::RecurringTask.where(key: task_keys).to_a
end

def schedule(task)
Expand Down
8 changes: 5 additions & 3 deletions lib/solid_queue/supervisor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,11 @@ def replace_fork(pid, status)
# executions it had claimed as failed so that they can be retried
# by some other worker.
def handle_claimed_jobs_by(terminated_fork, status)
if registered_process = SolidQueue::Process.find_by(name: terminated_fork.name)
error = Processes::ProcessExitError.new(status)
registered_process.fail_all_claimed_executions_with(error)
wrap_in_app_executor do
if registered_process = SolidQueue::Process.find_by(name: terminated_fork.name)
error = Processes::ProcessExitError.new(status)
registered_process.fail_all_claimed_executions_with(error)
end
end
end

Expand Down
Loading