Skip to content

Commit ed16398

Browse files
authored
Merge branch 'main' into aaa/health_server
2 parents b4a364a + ac912dd commit ed16398

File tree

15 files changed

+79
-41
lines changed

15 files changed

+79
-41
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ jobs:
2929
- 3.3
3030
- 3.4
3131
database: [ mysql, postgres, sqlite ]
32-
gemfile: [ rails_7_1, rails_7_2, rails_8_0, rails_main ]
32+
gemfile: [ rails_7_1, rails_7_2, rails_8_0, rails_8_1, rails_main ]
3333
exclude:
3434
- ruby-version: "3.1"
3535
gemfile: rails_8_0
36+
- ruby-version: "3.1"
37+
gemfile: rails_8_1
3638
- ruby-version: "3.1"
3739
gemfile: rails_main
3840
services:
@@ -77,4 +79,4 @@ jobs:
7779
path: |
7880
test/dummy/log/test.log
7981
if-no-files-found: ignore
80-
retention-days: 7
82+
retention-days: 30

Appraisals

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ appraise "rails-8-0" do
1515
gem "railties", "~> 8.0.0"
1616
end
1717

18+
appraise "rails-8-1" do
19+
gem "railties", "~> 8.1.0"
20+
end
21+
1822
appraise "rails-main" do
1923
gem "railties", github: "rails/rails", branch: "main"
2024
end

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
solid_queue (1.2.2)
4+
solid_queue (1.2.3)
55
activejob (>= 7.1)
66
activerecord (>= 7.1)
77
concurrent-ruby (>= 1.3.1)

Rakefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ require "bundler/setup"
55
APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
66
load "rails/tasks/engine.rake"
77

8-
load "rails/tasks/statistics.rake"
8+
if Rails::VERSION::MAJOR < 8
9+
load "rails/tasks/statistics.rake"
10+
end
911

1012
require "bundler/gem_tasks"
1113
require "rake/tasklib"

gemfiles/rails_8_1.gemfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "railties", "~> 8.1.0"
6+
7+
gemspec path: "../"

lib/solid_queue/configuration.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ def load_config_from_file(file)
222222
if file.exist?
223223
ActiveSupport::ConfigurationFile.parse(file).deep_symbolize_keys
224224
else
225+
puts "[solid_queue] WARNING: Provided configuration file '#{file}' does not exist. Falling back to default configuration."
225226
{}
226227
end
227228
end

lib/solid_queue/processes/registrable.rb

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,19 @@ def process_id
1818
attr_accessor :process
1919

2020
def register
21-
@process = SolidQueue::Process.register \
22-
kind: kind,
23-
name: name,
24-
pid: pid,
25-
hostname: hostname,
26-
supervisor: try(:supervisor),
27-
metadata: metadata.compact
21+
wrap_in_app_executor do
22+
@process = SolidQueue::Process.register \
23+
kind: kind,
24+
name: name,
25+
pid: pid,
26+
hostname: hostname,
27+
supervisor: try(:supervisor),
28+
metadata: metadata.compact
29+
end
2830
end
2931

3032
def deregister
31-
process&.deregister
33+
wrap_in_app_executor { process&.deregister }
3234
end
3335

3436
def registered?

lib/solid_queue/scheduler/recurring_schedule.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def persist_tasks
4646
end
4747

4848
def reload_tasks
49-
@configured_tasks = SolidQueue::RecurringTask.where(key: task_keys)
49+
@configured_tasks = SolidQueue::RecurringTask.where(key: task_keys).to_a
5050
end
5151

5252
def schedule(task)

lib/solid_queue/supervisor.rb

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,18 @@ def initialize(configuration)
2929
end
3030

3131
def start
32-
wrap_in_app_executor do
33-
boot
34-
run_start_hooks
32+
boot
33+
run_start_hooks
3534

36-
start_processes
37-
launch_maintenance_task
35+
start_processes
36+
launch_maintenance_task
3837

39-
supervise
40-
end
38+
supervise
4139
end
4240

4341
def stop
44-
wrap_in_app_executor do
45-
super
46-
run_stop_hooks
47-
end
42+
super
43+
run_stop_hooks
4844
end
4945

5046
private
@@ -180,9 +176,11 @@ def replace_fork(pid, status)
180176
# executions it had claimed as failed so that they can be retried
181177
# by some other worker.
182178
def handle_claimed_jobs_by(terminated_fork, status)
183-
if registered_process = SolidQueue::Process.find_by(name: terminated_fork.name)
184-
error = Processes::ProcessExitError.new(status)
185-
registered_process.fail_all_claimed_executions_with(error)
179+
wrap_in_app_executor do
180+
if registered_process = SolidQueue::Process.find_by(name: terminated_fork.name)
181+
error = Processes::ProcessExitError.new(status)
182+
registered_process.fail_all_claimed_executions_with(error)
183+
end
186184
end
187185
end
188186

lib/solid_queue/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module SolidQueue
2-
VERSION = "1.2.2"
2+
VERSION = "1.2.3"
33
end

0 commit comments

Comments
 (0)