From 901b4bab5e40968705f622bcf5e467b9b45f6582 Mon Sep 17 00:00:00 2001 From: "Jesse C. Fisher" Date: Mon, 24 Jun 2024 09:52:17 +0000 Subject: [PATCH] Disable Delayed Job scheduler and Telegram bots --- Capfile | 2 +- Gemfile | 10 ++--- Gemfile.lock | 50 ------------------------- app/controllers/bots_controller.rb | 3 +- config/application.rb | 4 +- config/initializers/activejob_status.rb | 2 +- db/schema.rb | 3 +- 7 files changed, 12 insertions(+), 62 deletions(-) diff --git a/Capfile b/Capfile index ea78041f..005089d3 100644 --- a/Capfile +++ b/Capfile @@ -16,7 +16,7 @@ require 'capistrano/rails/assets' require 'capistrano/rails/migrations' require 'capistrano/postgresql' #require 'capistrano/bower' -require 'capistrano/delayed_job' +# TODO enable job scheduler require 'capistrano/delayed_job' # Includes tasks from other gems included in your Gemfile diff --git a/Gemfile b/Gemfile index 2a51dc9e..313138a0 100644 --- a/Gemfile +++ b/Gemfile @@ -38,7 +38,7 @@ group :development do gem 'capistrano-nginx', github: 'koenpunt/capistrano-nginx' gem "capistrano-db-tasks", require: false gem "capistrano-postgresql" #, '~> 4.2.0' - gem 'capistrano3-delayed-job', '~> 1.0' +# TODO enable job scheduler gem 'capistrano3-delayed-job', '~> 1.0' # required for ecdsa key gem "bcrypt_pbkdf", require: false gem "net-ssh", ">= 4.0.0", require: false @@ -84,8 +84,8 @@ gem 'importmap-rails' gem 'turbo-rails' gem 'stimulus-rails' gem 'will_paginate' -gem 'telegram-bot-ruby', '~> 1.0' -gem 'delayed_job_active_record' -gem 'daemons' +# TODO enable telegram bots with job scheduler gem 'telegram-bot-ruby', '~> 1.0' +# TODO enable job scheduler gem 'delayed_job_active_record' +# TODO enable job scheduler gem 'daemons' -gem "activejob-status", "~> 1.0" +# TODO enable job scheduler gem "activejob-status", "~> 1.0" diff --git a/Gemfile.lock b/Gemfile.lock index deea60aa..f6507935 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -60,9 +60,6 @@ GEM activejob (7.1.2) activesupport (= 7.1.2) globalid (>= 0.3.6) - activejob-status (1.0.0) - activejob (>= 6.0) - activesupport (>= 6.0) activemodel (7.1.2) activesupport (= 7.1.2) activerecord (7.1.2) @@ -126,9 +123,6 @@ GEM capistrano-rbenv (2.2.0) capistrano (~> 3.1) sshkit (~> 1.3) - capistrano3-delayed-job (1.7.6) - capistrano (~> 3.0, >= 3.0.0) - daemons (~> 1.3) capistrano3-puma (6.0.0.beta.1) capistrano (~> 3.7) capistrano-bundler @@ -162,7 +156,6 @@ GEM concurrent-ruby (1.2.2) connection_pool (2.4.1) crass (1.0.6) - daemons (1.4.1) database_cleaner (2.0.2) database_cleaner-active_record (>= 2, < 3) database_cleaner-active_record (2.1.0) @@ -171,11 +164,6 @@ GEM database_cleaner-core (2.0.1) date (3.3.4) debug_inspector (1.1.0) - delayed_job (4.1.11) - activesupport (>= 3.0, < 8.0) - delayed_job_active_record (4.1.8) - activerecord (>= 3.0, < 8.0) - delayed_job (>= 3.0, < 5) devise (4.9.3) bcrypt (~> 3.0) orm_adapter (~> 0.1) @@ -193,25 +181,6 @@ GEM railties (>= 3.2) drb (2.2.0) ruby2_keywords - dry-core (1.0.1) - concurrent-ruby (~> 1.0) - zeitwerk (~> 2.6) - dry-inflector (1.0.0) - dry-logic (1.5.0) - concurrent-ruby (~> 1.0) - dry-core (~> 1.0, < 2) - zeitwerk (~> 2.6) - dry-struct (1.6.0) - dry-core (~> 1.0, < 2) - dry-types (>= 1.7, < 2) - ice_nine (~> 0.11) - zeitwerk (~> 2.6) - dry-types (1.7.1) - concurrent-ruby (~> 1.0) - dry-core (~> 1.0) - dry-inflector (~> 1.0) - dry-logic (~> 1.4) - zeitwerk (~> 2.6) ed25519 (1.3.0) em-websocket (0.5.3) eventmachine (>= 0.12.9) @@ -227,13 +196,6 @@ GEM railties (>= 3.0.0) faker (3.2.2) i18n (>= 1.8.11, < 2) - faraday (2.7.12) - base64 - faraday-net_http (>= 2.0, < 3.1) - ruby2_keywords (>= 0.0.4) - faraday-multipart (1.0.4) - multipart-post (~> 2) - faraday-net_http (3.0.2) ffi (1.16.3) formatador (1.1.0) friendly_id (5.4.2) @@ -288,7 +250,6 @@ GEM hub (1.12.4) i18n (1.14.1) concurrent-ruby (~> 1.0) - ice_nine (0.11.2) importmap-rails (1.2.3) actionpack (>= 6.0.0) activesupport (>= 6.0.0) @@ -333,7 +294,6 @@ GEM mini_portile2 (2.8.5) minitest (5.20.0) multi_json (1.15.0) - multipart-post (2.3.0) mutex_m (0.2.0) nenv (0.3.0) net-imap (0.4.7) @@ -533,11 +493,6 @@ GEM stimulus-rails (1.3.0) railties (>= 6.0.0) stringio (3.1.0) - telegram-bot-ruby (1.0.0) - dry-struct (~> 1.6) - faraday (~> 2.0) - faraday-multipart (~> 1.0) - zeitwerk (~> 2.6) temple (0.10.3) thor (1.3.0) tilt (2.3.0) @@ -570,7 +525,6 @@ PLATFORMS x86_64-linux DEPENDENCIES - activejob-status (~> 1.0) bcrypt_pbkdf better_errors binding_of_caller @@ -582,15 +536,12 @@ DEPENDENCIES capistrano-rails capistrano-rails-console capistrano-rbenv - capistrano3-delayed-job (~> 1.0) capistrano3-puma (~> 6.0.beta) capybara capybara-screenshot ci_reporter_rspec coffee-rails - daemons database_cleaner - delayed_job_active_record devise devise_invitable dotenv-rails @@ -641,7 +592,6 @@ DEPENDENCIES spring-commands-rspec sprockets stimulus-rails - telegram-bot-ruby (~> 1.0) turbo-rails webdrivers will_paginate diff --git a/app/controllers/bots_controller.rb b/app/controllers/bots_controller.rb index d9956e6a..6832eeb0 100644 --- a/app/controllers/bots_controller.rb +++ b/app/controllers/bots_controller.rb @@ -23,7 +23,8 @@ class BotsController < ApplicationController def telegram_listen authorize @bot - @bot.delay.telegram_listen + # TODO enable bots with job scheduler + # @bot.delay.telegram_listen redirect_to request.referrer end diff --git a/config/application.rb b/config/application.rb index 096422aa..b7542264 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,7 +1,7 @@ require_relative "boot" require "rails/all" -require 'telegram/bot' +# TODO enable telegram bots with job scheduler require 'telegram/bot' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. @@ -20,6 +20,6 @@ module MyTendyZone # # config.time_zone = "Central Time (US & Canada)" # config.eager_load_paths << Rails.root.join("extras") - config.active_job.queue_adapter = :delayed_job + # TODO enable job scheduler config.active_job.queue_adapter = :delayed_job end end diff --git a/config/initializers/activejob_status.rb b/config/initializers/activejob_status.rb index 1af33eea..250b079c 100644 --- a/config/initializers/activejob_status.rb +++ b/config/initializers/activejob_status.rb @@ -2,4 +2,4 @@ # Available options are: :status, :serialized_job, :exception # Default is [:status] # -ActiveJob::Status.options = { includes: %i[status exception] } +# TODO enable job scheduler ActiveJob::Status.options = { includes: %i[status exception] } diff --git a/db/schema.rb b/db/schema.rb index 02284533..dade45c9 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -79,7 +79,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_03_25_142502) do t.integer "sluggable_id", null: false t.string "sluggable_type", limit: 50 t.string "scope" - t.datetime "created_at" + t.datetime "created_at", precision: nil t.index ["slug", "sluggable_type", "scope"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope", unique: true t.index ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type" t.index ["sluggable_type", "sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_type_and_sluggable_id" @@ -295,7 +295,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_03_25_142502) do t.integer "invitations_count", default: 0 t.string "soft_token" t.integer "win_count", default: 0 - t.integer "points" t.index ["email"], name: "index_users_on_email", unique: true t.index ["invitation_token"], name: "index_users_on_invitation_token", unique: true t.index ["invitations_count"], name: "index_users_on_invitations_count"