Commit ed61ef6d authored by cmrd Senya's avatar cmrd Senya Committed by Dennis Schubert

Replace sidetiq with sidekiq-cron

closes #6616
parent 515cda76
......@@ -69,6 +69,7 @@ Contributions are very welcome, the hard work is done!
* Port flash messages to backbone [#6395](https://github.com/diaspora/diaspora/6395)
* Change login/registration/forgot password button color [#6504](https://github.com/diaspora/diaspora/pull/6504)
* A note regarding ignoring users was added to the failure messages on commenting/liking [#6646](https://github.com/diaspora/diaspora/pull/6646)
* Replace sidetiq with sidekiq-cron [#6616](https://github.com/diaspora/diaspora/pull/6616)
## Bug fixes
* Destroy Participation when removing interactions with a post [#5852](https://github.com/diaspora/diaspora/pull/5852)
......
......@@ -32,12 +32,12 @@ gem "simple_captcha2", "0.3.4", require: "simple_captcha"
# Background processing
gem "sidekiq", "3.4.2"
gem "sidekiq", "4.0.1"
gem "sinatra", "1.4.6"
# Scheduled processing
gem "sidetiq", "0.6.3"
gem "sidekiq-cron", "0.4.1"
# Compression
......
......@@ -118,6 +118,7 @@ GEM
compass (~> 1.0.0)
sass-rails (< 5.1)
sprockets (< 2.13)
concurrent-ruby (1.0.0)
configurate (0.3.1)
connection_pool (2.2.0)
crack (0.4.3)
......@@ -404,7 +405,6 @@ GEM
actionpack (>= 3.0.0)
i18n-inflector (~> 2.6)
railties (>= 3.0.0)
ice_cube (0.11.1)
inflecto (0.0.2)
ipaddress (0.8.0)
jasmine (2.4.0)
......@@ -728,6 +728,7 @@ GEM
ruby-oembed (0.9.0)
ruby-progressbar (1.7.5)
rubyzip (1.1.7)
rufus-scheduler (3.2.0)
rugged (0.23.3)
safe_yaml (1.0.4)
sass (3.4.20)
......@@ -752,16 +753,15 @@ GEM
shellany (0.0.1)
shoulda-matchers (3.0.1)
activesupport (>= 4.0.0)
sidekiq (3.4.2)
celluloid (~> 0.16.0)
sidekiq (4.0.1)
concurrent-ruby (~> 1.0)
connection_pool (~> 2.2, >= 2.2.0)
json (~> 1.0)
redis (~> 3.2, >= 3.2.1)
redis-namespace (~> 1.5, >= 1.5.2)
sidetiq (0.6.3)
celluloid (>= 0.14.1)
ice_cube (= 0.11.1)
sidekiq (>= 3.0.0)
sidekiq-cron (0.4.1)
redis-namespace (>= 1.5.2)
rufus-scheduler (>= 2.0.24)
sidekiq (>= 4.0.0)
sigar (0.7.3)
simple_captcha2 (0.3.4)
rails (>= 4.1)
......@@ -998,8 +998,8 @@ DEPENDENCIES
sass-rails (= 5.0.4)
selenium-webdriver (= 2.47.1)
shoulda-matchers (= 3.0.1)
sidekiq (= 3.4.2)
sidetiq (= 0.6.3)
sidekiq (= 4.0.1)
sidekiq-cron (= 0.4.1)
simple_captcha2 (= 0.3.4)
simplecov (= 0.11.1)
sinatra (= 1.4.6)
......
module Workers
class CleanCachedFiles < Base
include Sidetiq::Schedulable
sidekiq_options queue: :maintenance
recurrence { daily }
def perform
CarrierWave.clean_cached_files!
end
end
end
end
......@@ -4,12 +4,8 @@
module Workers
class QueueUsersForRemoval < Base
include Sidetiq::Schedulable
sidekiq_options queue: :maintenance
recurrence { daily }
def perform
# Queue users for removal due to inactivity
if AppConfig.settings.maintenance.remove_old_users.enable?
......@@ -37,5 +33,5 @@ module Workers
end
end
end
end
end
end
module Workers
class RecurringPodCheck < Base
include Sidetiq::Schedulable
sidekiq_options queue: :maintenance
recurrence { daily }
def perform
Pod.check_all!
end
......
......@@ -52,3 +52,9 @@ end
Sidekiq.configure_client do |config|
config.redis = AppConfig.get_redis_options
end
schedule_file = "config/schedule.yml"
if File.exist?(schedule_file) && Sidekiq.server?
Sidekiq::Cron::Job.load_from_hash YAML.load_file(schedule_file)
end
......@@ -3,7 +3,7 @@
# the COPYRIGHT file.
require 'sidekiq/web'
require 'sidetiq/web'
require "sidekiq/cron/web"
Diaspora::Application.routes.draw do
......
clean_cached_files:
cron: "0 0 * * *"
class: "Workers::CleanCachedFiles"
queue: "clean_cached_files"
queue_users_for_removal:
cron: "0 0 * * *"
class: "Workers::QueueUsersForRemoval"
queue: queue_users_for_removal
recurring_pod_check:
cron: "0 0 * * *"
class: "Workers::RecurringPodCheck"
queue: recurring_pod_check
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment