From c513de376ec94f0fb5132ea6beca0799d427856e Mon Sep 17 00:00:00 2001 From: Anderson Macedo Date: Sun, 22 Dec 2024 11:06:36 -0300 Subject: [PATCH] Bump solid_queue, Rails, Ruby versions --- .ruby-version | 2 +- .tool-versions | 2 +- Dockerfile | 2 +- Gemfile | 4 +- Gemfile.lock | 193 ++++++++++---------- README.md | 2 +- app/controllers/latency_check_controller.rb | 2 +- config/initializers/solid_queue.rb | 17 -- 8 files changed, 109 insertions(+), 115 deletions(-) diff --git a/.ruby-version b/.ruby-version index a0891f56..9c25013d 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.4 +3.3.6 diff --git a/.tool-versions b/.tool-versions index 05668b72..5aa8e0c3 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1 @@ -ruby 3.3.4 +ruby 3.3.6 diff --git a/Dockerfile b/Dockerfile index e629c9ab..069430e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # syntax = docker/dockerfile:1 -ARG RUBY_VERSION=3.3.4 +ARG RUBY_VERSION=3.3.6 FROM docker.io/library/ruby:$RUBY_VERSION-slim as base # Rails app lives here diff --git a/Gemfile b/Gemfile index 96867e0d..b5635a7d 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby file: ".ruby-version" -gem "rails", "~> 8.0.0.beta1" +gem "rails", "~> 8.0.1" gem "bootsnap", require: false @@ -23,6 +23,8 @@ gem "kamal" gem "solid_queue" gem "solid_errors" +gem "yabeda" + # Queue management gem "mission_control-jobs" diff --git a/Gemfile.lock b/Gemfile.lock index 29d7e90c..f7f0029b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,29 +1,29 @@ GEM remote: https://rubygems.org/ specs: - actioncable (8.0.0.beta1) - actionpack (= 8.0.0.beta1) - activesupport (= 8.0.0.beta1) + actioncable (8.0.1) + actionpack (= 8.0.1) + activesupport (= 8.0.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (8.0.0.beta1) - actionpack (= 8.0.0.beta1) - activejob (= 8.0.0.beta1) - activerecord (= 8.0.0.beta1) - activestorage (= 8.0.0.beta1) - activesupport (= 8.0.0.beta1) + actionmailbox (8.0.1) + actionpack (= 8.0.1) + activejob (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) mail (>= 2.8.0) - actionmailer (8.0.0.beta1) - actionpack (= 8.0.0.beta1) - actionview (= 8.0.0.beta1) - activejob (= 8.0.0.beta1) - activesupport (= 8.0.0.beta1) + actionmailer (8.0.1) + actionpack (= 8.0.1) + actionview (= 8.0.1) + activejob (= 8.0.1) + activesupport (= 8.0.1) mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (8.0.0.beta1) - actionview (= 8.0.0.beta1) - activesupport (= 8.0.0.beta1) + actionpack (8.0.1) + actionview (= 8.0.1) + activesupport (= 8.0.1) nokogiri (>= 1.8.5) rack (>= 2.2.4) rack-session (>= 1.0.1) @@ -31,35 +31,35 @@ GEM rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) useragent (~> 0.16) - actiontext (8.0.0.beta1) - actionpack (= 8.0.0.beta1) - activerecord (= 8.0.0.beta1) - activestorage (= 8.0.0.beta1) - activesupport (= 8.0.0.beta1) + actiontext (8.0.1) + actionpack (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (8.0.0.beta1) - activesupport (= 8.0.0.beta1) + actionview (8.0.1) + activesupport (= 8.0.1) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (8.0.0.beta1) - activesupport (= 8.0.0.beta1) + activejob (8.0.1) + activesupport (= 8.0.1) globalid (>= 0.3.6) - activemodel (8.0.0.beta1) - activesupport (= 8.0.0.beta1) - activerecord (8.0.0.beta1) - activemodel (= 8.0.0.beta1) - activesupport (= 8.0.0.beta1) + activemodel (8.0.1) + activesupport (= 8.0.1) + activerecord (8.0.1) + activemodel (= 8.0.1) + activesupport (= 8.0.1) timeout (>= 0.4.0) - activestorage (8.0.0.beta1) - actionpack (= 8.0.0.beta1) - activejob (= 8.0.0.beta1) - activerecord (= 8.0.0.beta1) - activesupport (= 8.0.0.beta1) + activestorage (8.0.1) + actionpack (= 8.0.1) + activejob (= 8.0.1) + activerecord (= 8.0.1) + activesupport (= 8.0.1) marcel (~> 1.0) - activesupport (8.0.0.beta1) + activesupport (8.0.1) base64 benchmark (>= 0.3) bigdecimal @@ -74,10 +74,12 @@ GEM uri (>= 0.13.1) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) + anyway_config (2.6.4) + ruby-next-core (~> 1.0) ast (2.4.2) base64 (0.2.0) bcrypt_pbkdf (1.1.1) - benchmark (0.3.0) + benchmark (0.4.0) bigdecimal (3.1.8) bindex (0.8.1) blazer (3.0.3) @@ -114,16 +116,17 @@ GEM dartsass-rails (0.5.1) railties (>= 6.0.0) sass-embedded (~> 1.63) - date (3.3.4) + date (3.4.1) debug (1.9.2) irb (~> 1.10) reline (>= 0.3.8) docile (1.4.1) domain_name (0.6.20240107) - dotenv (3.1.4) + dotenv (3.1.7) drb (2.2.1) + dry-initializer (3.1.1) ed25519 (1.3.0) - erubi (1.13.0) + erubi (1.13.1) et-orbi (1.2.11) tzinfo fast_gettext (3.0.0) @@ -168,31 +171,31 @@ GEM actionpack (>= 6.0.0) activesupport (>= 6.0.0) railties (>= 6.0.0) - io-console (0.7.2) - irb (1.14.1) + io-console (0.8.0) + irb (1.14.3) rdoc (>= 4.0.0) reline (>= 0.4.2) json (2.7.2) - kamal (2.2.1) + kamal (2.4.0) activesupport (>= 7.0) base64 (~> 0.2) bcrypt_pbkdf (~> 1.0) concurrent-ruby (~> 1.2) dotenv (~> 3.1) ed25519 (~> 1.2) - net-ssh (~> 7.0) + net-ssh (~> 7.3) sshkit (>= 1.23.0, < 2.0) thor (~> 1.3) - zeitwerk (~> 2.5) + zeitwerk (>= 2.6.18, < 3.0) language_server-protocol (3.17.0.3) locale (2.1.4) - logger (1.6.1) + logger (1.6.4) lograge (0.14.0) actionpack (>= 4) activesupport (>= 4) railties (>= 4) request_store (~> 1.0) - loofah (2.22.0) + loofah (2.23.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -221,8 +224,8 @@ GEM mime-types-data (3.2024.0806) mini_magick (4.13.2) mini_mime (1.1.5) - mini_portile2 (2.8.7) - minitest (5.25.1) + mini_portile2 (2.8.8) + minitest (5.25.4) mission_control-jobs (0.3.1) importmap-rails irb (~> 1.13) @@ -235,7 +238,7 @@ GEM net-http-digest_auth (1.4.1) net-http-persistent (4.0.2) connection_pool (~> 2.2) - net-imap (0.4.16) + net-imap (0.5.3) date net-protocol net-pop (0.1.2) @@ -249,13 +252,13 @@ GEM net-smtp (0.5.0) net-protocol net-ssh (7.3.0) - nio4r (2.7.3) + nio4r (2.7.4) nkf (0.2.0) - nokogiri (1.16.7) + nokogiri (1.17.2) mini_portile2 (~> 2.8.2) racc (~> 1.4) numerizer (0.2.0) - ostruct (0.6.0) + ostruct (0.6.1) parallel (1.26.3) parser (3.3.4.2) ast (~> 2.4.1) @@ -268,45 +271,45 @@ GEM activesupport (>= 7.0.0) rack railties (>= 7.0.0) - psych (5.1.2) + psych (5.2.2) + date stringio public_suffix (6.0.1) puma (6.4.2) nio4r (~> 2.0) raabro (1.4.0) racc (1.8.1) - rack (3.1.7) + rack (3.1.8) rack-session (2.0.0) rack (>= 3.0.0) rack-test (2.1.0) rack (>= 1.3) - rackup (2.1.0) + rackup (2.2.1) rack (>= 3) - webrick (~> 1.8) - rails (8.0.0.beta1) - actioncable (= 8.0.0.beta1) - actionmailbox (= 8.0.0.beta1) - actionmailer (= 8.0.0.beta1) - actionpack (= 8.0.0.beta1) - actiontext (= 8.0.0.beta1) - actionview (= 8.0.0.beta1) - activejob (= 8.0.0.beta1) - activemodel (= 8.0.0.beta1) - activerecord (= 8.0.0.beta1) - activestorage (= 8.0.0.beta1) - activesupport (= 8.0.0.beta1) + rails (8.0.1) + actioncable (= 8.0.1) + actionmailbox (= 8.0.1) + actionmailer (= 8.0.1) + actionpack (= 8.0.1) + actiontext (= 8.0.1) + actionview (= 8.0.1) + activejob (= 8.0.1) + activemodel (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) bundler (>= 1.15.0) - railties (= 8.0.0.beta1) + railties (= 8.0.1) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.0) + rails-html-sanitizer (1.6.2) loofah (~> 2.21) - nokogiri (~> 1.14) - railties (8.0.0.beta1) - actionpack (= 8.0.0.beta1) - activesupport (= 8.0.0.beta1) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + railties (8.0.1) + actionpack (= 8.0.1) + activesupport (= 8.0.1) irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) @@ -314,14 +317,14 @@ GEM zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.2.1) - rdoc (6.7.0) + rdoc (6.10.0) psych (>= 4.0.0) redis (5.2.0) redis-client (>= 0.22.0) redis-client (0.22.2) connection_pool regexp_parser (2.9.2) - reline (0.5.10) + reline (0.6.0) io-console (~> 0.5) request_store (1.7.0) rack (>= 1.4) @@ -358,6 +361,7 @@ GEM rubocop-minitest rubocop-performance rubocop-rails + ruby-next-core (1.0.3) ruby-progressbar (1.13.0) ruby-vips (2.2.2) ffi (~> 1.12) @@ -369,7 +373,7 @@ GEM sass-embedded (1.77.8) google-protobuf (~> 4.26) rake (>= 13) - securerandom (0.3.1) + securerandom (0.4.1) simplecov (0.17.1) docile (~> 1.1) json (>= 1.8, < 3) @@ -383,7 +387,7 @@ GEM activerecord (>= 7.0) activesupport (>= 7.0) railties (>= 7.0) - solid_queue (1.0.0) + solid_queue (1.1.0) activejob (>= 7.1) activerecord (>= 7.1) concurrent-ruby (>= 1.3.1) @@ -392,7 +396,7 @@ GEM thor (~> 1.3.1) sqlite3 (2.1.0) mini_portile2 (~> 2.8.0) - sshkit (1.23.1) + sshkit (1.23.2) base64 net-scp (>= 1.1.2) net-sftp (>= 2.1.2) @@ -400,12 +404,12 @@ GEM ostruct stimulus-rails (1.3.4) railties (>= 6.0.0) - stringio (3.1.1) + stringio (3.1.2) strscan (3.1.0) text (1.3.1) thor (1.3.2) thruster (0.1.8) - timeout (0.4.1) + timeout (0.4.3) turbo-rails (2.0.6) actionpack (>= 6.0.0) activejob (>= 6.0.0) @@ -413,11 +417,11 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) - uri (0.13.1) - useragent (0.16.10) + uri (1.0.2) + useragent (0.16.11) vcr (6.2.0) - view_component (3.13.0) - activesupport (>= 5.2.0, < 8.0) + view_component (3.21.0) + activesupport (>= 5.2.0, < 8.1) concurrent-ruby (~> 1.0) method_source (~> 1.0) web-console (4.2.1) @@ -429,7 +433,7 @@ GEM addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - webrick (1.8.2) + webrick (1.9.1) webrobots (0.1.2) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) @@ -437,7 +441,11 @@ GEM wheretz (0.0.6) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.18) + yabeda (0.13.1) + anyway_config (>= 1.0, < 3) + concurrent-ruby + dry-initializer + zeitwerk (2.7.1) PLATFORMS ruby @@ -464,7 +472,7 @@ DEPENDENCIES mocha propshaft puma - rails (~> 8.0.0.beta1) + rails (~> 8.0.1) redis (>= 4.0.1) requestjs-rails rubocop-rails-omakase @@ -480,9 +488,10 @@ DEPENDENCIES web-console webmock wheretz + yabeda RUBY VERSION - ruby 3.3.4p94 + ruby 3.3.6p108 BUNDLED WITH - 2.5.20 + 2.5.22 diff --git a/README.md b/README.md index 1229600f..1908bba1 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ MAL Heatmap is a tool for tracking your anime/manga consumption based on your myanimelist.net recent history.
- This app crawls the recent user history daily and generates a full visualization of all activities like Github contributions calendar.k + This app crawls the recent user history daily and generates a full visualization of all activities like Github contributions calendar.

It also generates an image of your activities calendar that you can embed into your myanimelist.net profile or forum signature extending your MAL experience. diff --git a/app/controllers/latency_check_controller.rb b/app/controllers/latency_check_controller.rb index 4a135acf..1c03a4b1 100644 --- a/app/controllers/latency_check_controller.rb +++ b/app/controllers/latency_check_controller.rb @@ -6,7 +6,7 @@ class LatencyCheckController < ApplicationController def show queue = SolidQueue::Queue.find_by_name(params.require(:queue)) - response = { queue: queue.name, latency: ActiveSupport::Duration.build(queue.latency.to_i).inspect } + response = { queue: queue.name, latency: queue.human_latency } if queue.latency > threshold render json: response, status: :service_unavailable diff --git a/config/initializers/solid_queue.rb b/config/initializers/solid_queue.rb index c52b3142..b72295f3 100644 --- a/config/initializers/solid_queue.rb +++ b/config/initializers/solid_queue.rb @@ -1,20 +1,3 @@ Rails.application.configure do config.solid_queue.silence_polling = true end - -require "solid_queue" - -module QueueExtensions - extend ActiveSupport::Concern - - def latency - now = Time.current - oldest_job = SolidQueue::ReadyExecution.queued_as(name).minimum(:created_at) || now - - now - oldest_job - end -end - -Rails.configuration.to_prepare do - SolidQueue::Queue.include(QueueExtensions) -end