sidekiq

How can I password-protect my /sidekiq route (i.e. require authentication for the Sidekiq::Web tool)?

我们两清 提交于 2019-12-02 18:42:06
I am using sidekiq in my rails application. By Default, Sidekiq can be accessed by anybody by appending "/sidekiq" after the url. I want to password protect / authenticate only the sidekiq part. How can i do that? bravenewweb Put the following into your sidekiq initializer require 'sidekiq' require 'sidekiq/web' Sidekiq::Web.use(Rack::Auth::Basic) do |user, password| [user, password] == ["sidekiqadmin", "yourpassword"] end And in the routes file: authenticate :user do mount Sidekiq::Web => '/sidekiq' end Mark Nadig See "Security" under https://github.com/mperham/sidekiq/wiki/Monitoring Sidekiq

mail_form gem with sidekiq worker

最后都变了- 提交于 2019-12-02 18:20:21
问题 How to make mail_form gem work with sidekiq worker? https://github.com/plataformatec/mail_form I'm probably doing something wrong but this code throws me NoMethodError - contact_worker.rb class ContactWorker include Sidekiq::Worker def perform(c) c.deliver end end - contacts_controller.rb def create @contact = Contact.new(contact_params) @contact.request = request ContactWorker.perform_async(@contact) redirect_to root_path end - 2015-07-26T19:12:46.746Z 5785 TID-oxh33etuc ContactWorker JID

Sidekiq Rails 4.2 Use Active Job or Worker? What's the difference

烂漫一生 提交于 2019-12-02 17:40:19
This is my first processing jobs asynchronously I am implementing Sidekiq for background processing in my app. I will use it for reminder emails and in-app notifications. I am confused as to whether I should use Active Job to create a job that sends an email or a Sidekiq Worker to send an email. They seem to do the same thing and Rails 4.2 Active Job seems very new…is it replacing the need for a Sidekiq Worker? Below is the same sending a mailer code using an Active Job job and a Sidekiq Worker. I am using Whenever gem for scheduling. my_mailers.rb class MyMailers < ActionMailer::Base def some

Sidekiq not processing queue

删除回忆录丶 提交于 2019-12-02 16:05:19
What possible reasons can Sidekiq prevent from processing jobs in the queue? The queue is full. The log file sidekiq.log indicates no activity at all. Thus the queue is full but the log is empty, and Sidekiq does not seem to process items. There seem to no worker processing jobs. Restarting Redis or flush it with FLUSHALL or FLUSHDB as no effect. Sidekiq has been started with bundle exec sidekiq -L log/sidekiq.log and produces the following log file: 2013-05-30..Booting Sidekiq 2.12.0 using redis://localhost:6379/0 with options {} 2013-05-30..Running in ruby 1.9.3p374 (2013-01-15 revision

How to run sidekiq in production server?

风流意气都作罢 提交于 2019-12-02 14:08:11
I have a server with apache + passenger. How will I run sidekiq in production? Any configuration needed to run the bundle exec sidekiq Thanks Yersin bundle exec sidekiq -d -L log/sidekiq.log -C config/sidekiq.yml -e production -d , Daemonize process -L , path to writable logfile -C , path to YAML config file -e , Application environment A better solution than using the daemonization -d flag is to leverage the process supervisor provided by your OS. This is also the recommendation given by the sidekiq gem's wiki : I strongly recommend people not to use the -d flag but instead use a process

Are there console commands to look at whats in the queue and to clear the queue in Sidekiq?

情到浓时终转凉″ 提交于 2019-12-02 13:50:10
I'm used to using delayed_jobs method of going into the console to see whats in the queue, and the ease of clearing the queue when needed. Are there similar commands in Sidekiq for this? Thanks! I haven't ever used Sidekiq, so it's possible that there are methods just for viewing the queued jobs, but they would really just be wrappers around Redis commands, since that's basically all Sidekiq (and Resque) is: # See workers Sidekiq::Client.registered_workers # See queues Sidekiq::Client.registered_queues # See all jobs for one queue Sidekiq.redis { |r| r.lrange "queue:app_queue", 0, -1 } # See

mail_form gem with sidekiq worker

99封情书 提交于 2019-12-02 09:40:55
How to make mail_form gem work with sidekiq worker? https://github.com/plataformatec/mail_form I'm probably doing something wrong but this code throws me NoMethodError - contact_worker.rb class ContactWorker include Sidekiq::Worker def perform(c) c.deliver end end - contacts_controller.rb def create @contact = Contact.new(contact_params) @contact.request = request ContactWorker.perform_async(@contact) redirect_to root_path end - 2015-07-26T19:12:46.746Z 5785 TID-oxh33etuc ContactWorker JID-014a6a9987980a03f49c355c INFO: start 2015-07-26T19:12:46.747Z 5785 TID-oxh33etuc ContactWorker JID

Sidekiq error: could not connect to server: No such file or directory

孤人 提交于 2019-12-02 03:11:27
问题 I am having trouble with my sidekiq, heroku, redistogo, rails 4 configuration. I have 1 dyno and 1 worker on heroku. I am just using the worker for a get request to an external api. Here is the error I get in my Heroku logs: app[worker.1]: could not connect to server: No such file or directory app[worker.1]: connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? app[worker.1]: Is the server running locally and accepting Here is my config/initializers/sidekiq.rb if Rails.env

Sidekiq schedule same worker to queue when done

二次信任 提交于 2019-12-01 08:05:16
I am using Sidekiq with Rails 3, with the following worker class: class BotWorker include Sidekiq::Worker def perform(user_id) user = User.find(user_id) puts user.email if condition # always true for now BotWorker.perform_in(1.hour, user_id) # not working end end end My controller simply has BotWorker.perform_async(user_id) However, on the Sidekiq dashboard, it doesn't seem like another worker is scheduled. Also would like to note that the recurrence is conditional so it doesn't seem like I can use sidetiq or some sidekiq scheduling extension. Still new to Sidekiq, read the documentation. What

Sidekiq schedule same worker to queue when done

痞子三分冷 提交于 2019-12-01 04:55:39
问题 I am using Sidekiq with Rails 3, with the following worker class: class BotWorker include Sidekiq::Worker def perform(user_id) user = User.find(user_id) puts user.email if condition # always true for now BotWorker.perform_in(1.hour, user_id) # not working end end end My controller simply has BotWorker.perform_async(user_id) However, on the Sidekiq dashboard, it doesn't seem like another worker is scheduled. Also would like to note that the recurrence is conditional so it doesn't seem like I