[DRE-commits] [diaspora] 01/06: replace sidetiq
Praveen Arimbrathodiyil
praveen at moszumanska.debian.org
Wed Jan 27 16:35:29 UTC 2016
This is an automated email from the git hooks/post-receive script.
praveen pushed a commit to branch master
in repository diaspora.
commit c7383a3cc425c6c7c848200cc5e2604b7bd39354
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date: Wed Jan 27 18:49:22 2016 +0530
replace sidetiq
---
debian/changelog | 7 ++
debian/control | 2 +-
debian/patches/045-replace-sidetiq.patch | 125 +++++++++++++++++++++++++++++++
debian/patches/series | 1 +
4 files changed, 134 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index 4bc4e67..667be3c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+diaspora (0.5.5.1+debian-3) unstable; urgency=medium
+
+ * Replace sidetiq with sidekiq-cron (include upstream patch)
+ - sidetiq is unmaintained and it does not work with siekiq 4.0
+
+ -- Pirate Praveen <praveen at debian.org> Wed, 27 Jan 2016 18:47:30 +0530
+
diaspora (0.5.5.1+debian-2) unstable; urgency=medium
* Reupload to unstable
diff --git a/debian/control b/debian/control
index 686df0e..46f4817 100644
--- a/debian/control
+++ b/debian/control
@@ -36,7 +36,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ruby | ruby-interpreter,
ruby-sidekiq (>= 3.4.2~dfsg-2),
ruby-sidekiq (<< 3.5),
ruby-sinatra,
- ruby-sidetiq,
+ ruby-sidekiq-cron,
ruby-configurate (>= 0.2.0~),
ruby-rack-cors,
ruby-mysql2,
diff --git a/debian/patches/045-replace-sidetiq.patch b/debian/patches/045-replace-sidetiq.patch
new file mode 100644
index 0000000..c3fd95b
--- /dev/null
+++ b/debian/patches/045-replace-sidetiq.patch
@@ -0,0 +1,125 @@
+From ab41bef5797b44ea41e7defaaa18af6075c1199d Mon Sep 17 00:00:00 2001
+From: cmrd Senya <senya at riseup.net>
+Date: Mon, 4 Jan 2016 05:40:04 +0300
+Subject: [PATCH] Replace sidetiq with sidekiq-cron
+
+---
+ Gemfile | 4 ++--
+ app/workers/clean_cached_files.rb | 6 +-----
+ app/workers/queue_users_for_removal.rb | 8 ++------
+ config/initializers/sidekiq.rb | 6 ++++++
+ config/routes.rb | 2 +-
+ config/schedule.yml | 14 ++++++++++++++
+ 8 files changed, 36 insertions(+), 29 deletions(-)
+ create mode 100644 config/schedule.yml
+
+diff --git a/Gemfile b/Gemfile
+index 67cf53b..5a77859 100644
+--- a/Gemfile
++++ b/Gemfile
+@@ -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
+
+diff --git a/app/workers/clean_cached_files.rb b/app/workers/clean_cached_files.rb
+index 3497803..3e20e4a 100644
+--- a/app/workers/clean_cached_files.rb
++++ b/app/workers/clean_cached_files.rb
+@@ -1,13 +1,9 @@
+ module Workers
+ class CleanCachedFiles < Base
+- include Sidetiq::Schedulable
+-
+ sidekiq_options queue: :maintenance
+
+- recurrence { daily }
+-
+ def perform
+ CarrierWave.clean_cached_files!
+ end
+- end
++ end
+ end
+diff --git a/app/workers/queue_users_for_removal.rb b/app/workers/queue_users_for_removal.rb
+index b9565f7..bfe3a4e 100644
+--- a/app/workers/queue_users_for_removal.rb
++++ b/app/workers/queue_users_for_removal.rb
+@@ -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 @@ def perform
+ end
+ end
+ end
+- end
++ end
+ end
+diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb
+index 9709cc2..fa5ed37 100644
+--- a/config/initializers/sidekiq.rb
++++ b/config/initializers/sidekiq.rb
+@@ -52,3 +52,9 @@ def context
+ 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
+diff --git a/config/routes.rb b/config/routes.rb
+index 4babaf6..45c7721 100644
+--- a/config/routes.rb
++++ b/config/routes.rb
+@@ -3,7 +3,7 @@
+ # the COPYRIGHT file.
+
+ require 'sidekiq/web'
+-require 'sidetiq/web'
++require "sidekiq/cron/web"
+
+ Diaspora::Application.routes.draw do
+
+diff --git a/config/schedule.yml b/config/schedule.yml
+new file mode 100644
+index 0000000..1407cfd
+--- /dev/null
++++ b/config/schedule.yml
+@@ -0,0 +1,14 @@
++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
diff --git a/debian/patches/series b/debian/patches/series
index a939ddd..1ba5cb6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,4 @@
031-embedded-gems.patch
043-dont-do-git-checks.patch
044-work-around-sprockets3.patch
+045-replace-sidetiq.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/diaspora.git
More information about the Pkg-ruby-extras-commits
mailing list