Skip to content

Commit

Permalink
Rails Bump
Browse files Browse the repository at this point in the history
  • Loading branch information
Grigore-George-Mihai committed Oct 24, 2024
1 parent e6ac62d commit 2739868
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 63 deletions.
113 changes: 56 additions & 57 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (7.2.1.1)
actionpack (= 7.2.1.1)
activesupport (= 7.2.1.1)
actioncable (7.2.1.2)
actionpack (= 7.2.1.2)
activesupport (= 7.2.1.2)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.2.1.1)
actionpack (= 7.2.1.1)
activejob (= 7.2.1.1)
activerecord (= 7.2.1.1)
activestorage (= 7.2.1.1)
activesupport (= 7.2.1.1)
actionmailbox (7.2.1.2)
actionpack (= 7.2.1.2)
activejob (= 7.2.1.2)
activerecord (= 7.2.1.2)
activestorage (= 7.2.1.2)
activesupport (= 7.2.1.2)
mail (>= 2.8.0)
actionmailer (7.2.1.1)
actionpack (= 7.2.1.1)
actionview (= 7.2.1.1)
activejob (= 7.2.1.1)
activesupport (= 7.2.1.1)
actionmailer (7.2.1.2)
actionpack (= 7.2.1.2)
actionview (= 7.2.1.2)
activejob (= 7.2.1.2)
activesupport (= 7.2.1.2)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (7.2.1.1)
actionview (= 7.2.1.1)
activesupport (= 7.2.1.1)
actionpack (7.2.1.2)
actionview (= 7.2.1.2)
activesupport (= 7.2.1.2)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4, < 3.2)
Expand All @@ -32,15 +32,15 @@ GEM
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
useragent (~> 0.16)
actiontext (7.2.1.1)
actionpack (= 7.2.1.1)
activerecord (= 7.2.1.1)
activestorage (= 7.2.1.1)
activesupport (= 7.2.1.1)
actiontext (7.2.1.2)
actionpack (= 7.2.1.2)
activerecord (= 7.2.1.2)
activestorage (= 7.2.1.2)
activesupport (= 7.2.1.2)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.2.1.1)
activesupport (= 7.2.1.1)
actionview (7.2.1.2)
activesupport (= 7.2.1.2)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
Expand All @@ -64,26 +64,26 @@ GEM
sassc
sassc-rails
xdan-datetimepicker-rails (~> 2.5.1)
activejob (7.2.1.1)
activesupport (= 7.2.1.1)
activejob (7.2.1.2)
activesupport (= 7.2.1.2)
globalid (>= 0.3.6)
activemodel (7.2.1.1)
activesupport (= 7.2.1.1)
activemodel (7.2.1.2)
activesupport (= 7.2.1.2)
activemodel-serializers-xml (1.0.3)
activemodel (>= 5.0.0.a)
activesupport (>= 5.0.0.a)
builder (~> 3.1)
activerecord (7.2.1.1)
activemodel (= 7.2.1.1)
activesupport (= 7.2.1.1)
activerecord (7.2.1.2)
activemodel (= 7.2.1.2)
activesupport (= 7.2.1.2)
timeout (>= 0.4.0)
activestorage (7.2.1.1)
actionpack (= 7.2.1.1)
activejob (= 7.2.1.1)
activerecord (= 7.2.1.1)
activesupport (= 7.2.1.1)
activestorage (7.2.1.2)
actionpack (= 7.2.1.2)
activejob (= 7.2.1.2)
activerecord (= 7.2.1.2)
activesupport (= 7.2.1.2)
marcel (~> 1.0)
activesupport (7.2.1.1)
activesupport (7.2.1.2)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
Expand Down Expand Up @@ -210,7 +210,7 @@ GEM
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.7.2)
json (2.7.3)
kaminari (1.2.2)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.2)
Expand Down Expand Up @@ -286,30 +286,30 @@ GEM
rackup (2.1.0)
rack (>= 3)
webrick (~> 1.8)
rails (7.2.1.1)
actioncable (= 7.2.1.1)
actionmailbox (= 7.2.1.1)
actionmailer (= 7.2.1.1)
actionpack (= 7.2.1.1)
actiontext (= 7.2.1.1)
actionview (= 7.2.1.1)
activejob (= 7.2.1.1)
activemodel (= 7.2.1.1)
activerecord (= 7.2.1.1)
activestorage (= 7.2.1.1)
activesupport (= 7.2.1.1)
rails (7.2.1.2)
actioncable (= 7.2.1.2)
actionmailbox (= 7.2.1.2)
actionmailer (= 7.2.1.2)
actionpack (= 7.2.1.2)
actiontext (= 7.2.1.2)
actionview (= 7.2.1.2)
activejob (= 7.2.1.2)
activemodel (= 7.2.1.2)
activerecord (= 7.2.1.2)
activestorage (= 7.2.1.2)
activesupport (= 7.2.1.2)
bundler (>= 1.15.0)
railties (= 7.2.1.1)
railties (= 7.2.1.2)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.2.1.1)
actionpack (= 7.2.1.1)
activesupport (= 7.2.1.1)
railties (7.2.1.2)
actionpack (= 7.2.1.2)
activesupport (= 7.2.1.2)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
Expand Down Expand Up @@ -337,7 +337,7 @@ GEM
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
rexml (3.3.8)
rexml (3.3.9)
rollbar (3.6.0)
rspec-core (3.13.2)
rspec-support (~> 3.13.0)
Expand Down Expand Up @@ -419,8 +419,7 @@ GEM
websocket (~> 1.0)
shoulda-matchers (6.4.0)
activesupport (>= 5.2.0)
sidekiq (7.3.2)
concurrent-ruby (< 2)
sidekiq (7.3.4)
connection_pool (>= 2.3.0)
logger
rack (>= 2.2.4)
Expand Down
2 changes: 0 additions & 2 deletions app/sidekiq/pg/capture_query_stats_job.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require "sidekiq-scheduler"

module Pg
class CaptureQueryStatsJob
include Sidekiq::Job
Expand Down
2 changes: 0 additions & 2 deletions app/sidekiq/pg/clear_query_stats_job.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require "sidekiq-scheduler"

module Pg
class ClearQueryStatsJob
include Sidekiq::Job
Expand Down
3 changes: 3 additions & 0 deletions config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@

require_relative "config/environment"

require 'sidekiq/web'
require 'sidekiq-scheduler/web'

run Rails.application
Rails.application.load_server
12 changes: 12 additions & 0 deletions config/initializers/sidekiq_scheduler.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Sidekiq.configure_server do |config|
config.on(:startup) do
schedule_file = Rails.root.join("config/scheduler/#{Rails.env}.yml")

if File.exist?(schedule_file)
Sidekiq.schedule = YAML.load_file(schedule_file)
SidekiqScheduler::Scheduler.instance.reload_schedule!
else
Rails.logger.info "No schedule file found for #{Rails.env}. Skipping job scheduling."
end
end
end
2 changes: 0 additions & 2 deletions config/sidekiq.yml → config/scheduler/production.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
:scheduler:
:schedule:
capture_query_stats_job:
:environment: production
cron: "0 * * * *" # Runs every hour
class: "Pg::CaptureQueryStatsJob"

clear_query_stats_job:
:environment: production
cron: "0 0 * * 0" # Runs weekly on Sundays at midnight
class: "Pg::ClearQueryStatsJob"

0 comments on commit 2739868

Please sign in to comment.