sidekiq

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

我怕爱的太早我们不能终老 提交于 2019-12-03 06:11:49
问题 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? 回答1: 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

Is my understanding of Unicorn, Sidekiq and DB Pool size correct?

你。 提交于 2019-12-03 05:55:11
问题 I have Unicorn, Sidekiq and Postgres setup. I am trying to understand the right configuration to set up so that I don't hit the maximum db connection limit. In Opsworks, the m1.small Postgres RDS instance can have a max of 121 connections. I have a db pool size of 5. Consider this. Sidekiq and Unicorn are its own process. So the db pool size for each process is 5. Correct me if my understanding here is wrong. If I have 5 unicorn process', that means 5*5=25 database connections Now this is the

How to put sidekiq into Docker in a rails application?

不打扰是莪最后的温柔 提交于 2019-12-03 02:59:42
I am using rails, sidekiq and docker. My docker-compose.yml file sidekiq: build: . command: bundle exec sidekiq -C config/sidekiq.yml links: - db - redis config/sidekiq.yml file :pidfile: ./tmp/pids/sidekiq.pid :logfile: ./log/sidekiq.log :queues: - default After I run docker-compose up , the sidekiq service can not start rightly. sidekiq_1 | No such file or directory @ rb_sysopen - /testapp/tmp/pids/sidekiq.pid sidekiq_1 | /usr/local/bundle/gems/sidekiq-3.5.3/lib/sidekiq/cli.rb:365:in `initialize' sidekiq_1 | /usr/local/bundle/gems/sidekiq-3.5.3/lib/sidekiq/cli.rb:365:in `open' sidekiq_1 |

Run Sidekiq as daemon on Ubuntu

坚强是说给别人听的谎言 提交于 2019-12-03 01:33:13
How can I run sidekiq as daemon on Ubuntu? If I run bundle exec sidekiq -D I get invalid option: -D , is there any way to run it without some other controller, like god, upstart...? there's an option to Daemonize sidekiq, just pass -d option commit Running as daemon won't restart the sidekiq if it crashes unexpectedly. One alternate way could be to run sidekiq as a service (An upstart job). If the system is rebooted than also the upstart job will run sidekiq. Here is the complete script and method to run sidekiq as a service. After running sidekiq as a service you can simply start/stop/restart

Why is “❨╯°□°❩╯︵┻━┻” with such an encoding used for a method name?

你离开我真会死。 提交于 2019-12-03 01:19:56
I came across following method in sidekiq gem . Its just invoked from test_sidekiq.rb . def self.❨╯°□°❩╯︵┻━┻ puts "Calm down, bro" end This is the only link I was able to find on SO. Google can't understand ❨╯°□°❩╯︵┻━┻ . Why doesn't Ruby complain about this encoding? What is the purpose of this method (not much looking at its body)? Why did author @mike-perham use this name? Just for fun, or testing some boundaries? If you really do not understand the sense of the method name, that is a (Japanese-style) facemark. Whereas English facemarks are rotated 90 degrees counter-clockwise and are long

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

耗尽温柔 提交于 2019-12-03 00:02:57
问题 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! 回答1: 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

GitLab email notifications not sending

倖福魔咒の 提交于 2019-12-02 23:12:57
I just recently install GitLab v5.0 on an Ubuntu 12.04 server and am now having issues with email notifications. I can't get GitLab to send any emails of any kind. I've got my config/environments/production.rb file setup to use sendmail as the transport service: config.action_mailer.delivery_method = :sendmail config.action_mailer.perform_deliveries = true config.action_mailer.raise_delivery_errors = true And I can manually use sendmail successfully from the shell as described here: http://scratching.psybermonkey.net/2011/03/sendmail-how-to-test-sending-email.html My config/gitlab.yml file is

Best way to monitor for completion of a Sidekiq job?

你。 提交于 2019-12-02 20:38:59
I'm using a Sidekiq worker to complete some requests to Facebook after a user signs-in for the first time. Typically the task takes around 20 seconds or so. I'd like to load some information on to the page using an ajax request as soon as the sync is completed, but am unsure as to the best way to check for the job completion with Javascript. One possibility would be to configure the Sidekiq worker to set a cookie after the rest of the jobs are done. Then I can use a setTimeout function to keep checking for the cookie before calling the load function. But I'm unsure whether this is the best way

Is my understanding of Unicorn, Sidekiq and DB Pool size correct?

送分小仙女□ 提交于 2019-12-02 19:17:58
I have Unicorn, Sidekiq and Postgres setup. I am trying to understand the right configuration to set up so that I don't hit the maximum db connection limit. In Opsworks, the m1.small Postgres RDS instance can have a max of 121 connections. I have a db pool size of 5. Consider this. Sidekiq and Unicorn are its own process. So the db pool size for each process is 5. Correct me if my understanding here is wrong. If I have 5 unicorn process', that means 5*5=25 database connections Now this is the part where I am slightly confused, since Sidekiq is multithreaded. If Sidekiq has a concurrency of 5.

Rails: How to restart sidekiq?

北城以北 提交于 2019-12-02 19:04:36
I am using sidekiq gem to run API calls in background. I ran sidekiq in Daemon process like: bundle exec sidekiq -d Now I made some changes in my method, so I want to restart sidekiq. I tried to kill the sidekiq by using the below command: kill -9 process_id but it's not working. I want to know the command to restart sidekiq process. If you have any idea please share with me. I tried the below command also: sidekiqctl stop /path/to/pid file/pids/sidekiq.pid So after you find you proces_id, use the below command, that will stop the workers from getting new jobs, and they will finish existing