sidekiq

Heroku Error: ArgumentError: invalid uri scheme ''

南楼画角 提交于 2019-12-08 12:03:51
问题 I'm trying to get my Rails app to process background jobs with Sidekiq and to connect Sidekiq with redis-to-go on Heroku. Here's my Procfile : web: bundle exec puma -C config/puma.rb worker: bundle exec -C config/sidekiq.yml Here's my the Sidekiq.rb intializer file: require 'sidekiq' Sidekiq.configure_client do |config| config.redis = { url: ENV['REDIS_PROVIDER'] } end Sidekiq.configure_client do |config| config.redis = { url: ENV['REDIS_PROVIDER'] } end The REDIS_PROVIDER variable is set to

Democratic queue in Sidekiq

流过昼夜 提交于 2019-12-08 07:34:10
问题 Users can create a Project object that contain multiple tasks. When user tells the project to execute all those tasks are put on the default queue from Sidekiq. The problem is: if a user creates a project with 1000 tasks and hit the execute buttom, all those 1000 tasks are put in queue. If just after that, another user creates a project with only one task, when he hits executes this project, its only task is put on the end of the line. I'd like that background process to work on a more

Using devise-async to send out emails does not work (Rails/Sidekiq)

房东的猫 提交于 2019-12-08 07:21:49
问题 I have sidekiq (2.15.2) , devise (3.2.0) and devise-async (0.9.0) in my Rails app. I am trying to get devise-async to take over sending out emails. but without luck. I have followed the instructions like this: Add :async to User model: # models/user.rb class User include Mongoid::Document devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :confirmable, :async end Create an initializer: # config/initializers/devise_async.rb Devise::Async

Sidekiq UI is not loading assets - 404 not found

前提是你 提交于 2019-12-08 04:09:21
问题 I am having rails 4.1 application running with sidekiq on production. I have deployed it using nginx + unicorn. Also I have mounted sidekiq UI as follows, mount Sidekiq::Web => '/sidekiq' but since last few days when ever I try to access sidekiq UI, all assets of sidekiq returning 404, not found. But it was working previously fine. But not able to find what leads 404. Here is my settings nginx+unicorn settings for my app upstream sample_app { server unix:/tmp/sample_app.sock fail_timeout=0; }

daemonizing sidekiq with upstart script - is not working

大兔子大兔子 提交于 2019-12-07 22:28:41
问题 I'm trying to daemonize sidekiq using two upstart scripts following this example. Basically the workers service starts a fixed number of sidekiq services. The problem is that the sidekiq script fails at the line of code where I am starting sidekiq. I've tried to run the command directly in bash and it works fine. I tried all different commented lines and none works. So my question is what am I doing wrong? Where can I see the error messages? This is my modified sidekiq script: # /etc/init

How to pass current_user to Sidekiq's Worker

眉间皱痕 提交于 2019-12-07 17:47:38
问题 I am trying to pass current_user or User.find(1) to a worker module but getting error in the sidekiq's dashboard (localhost:3000/sidekiq/retries): NoMethodError: undefined method `supports' for "#":String note: my relations are ok ie: u = User.find(1) u.supports #=> [] supports_controller.rb: def create @user = current_user ProjectsWorker.perform_async(@user) ... end app/workers/projects_worker.rb: class ProjectsWorker include Sidekiq::Worker def perform(user) u = user @support = u.supports

sidekiq does not process jobs, jobs stuck in enqueue

孤者浪人 提交于 2019-12-07 11:07:07
问题 I have a simple application that works with the twitter stream api, sidekiq, unicorn and sinatra. All works well, instead of... the job are not being processed at all. They are stuck in Enqueued (And I know that from the sidekiq web UI). This is my code: Procfile: sidekiq: bundle exec sidekiq -C config/sidekiq.yml -e development -r ./lib/tweet_streamer.rb unicorn: bundle exec unicorn -c config/unicorn.rb redis: redis-stable/src/redis-server config/unicorn.rb: listen 5000, :tcp_nopush => true

Rails Heroku Sidekiq Confirm Procfile is Working

こ雲淡風輕ζ 提交于 2019-12-07 08:15:19
问题 I have set my Procfile in the root of my app: web: bundle exec thin start -p $PORT worker: bundle exec sidekiq -c 5 -v and I can see that heroku sees it when I push my rails app up via git push heroku master Procfile declares types -> web, worker The problem is that a bunch of jobs are just getting stuck in the "enqueue" section. If I run heroku run bundle exec sidekiq from the command line, only then will the jobs process. Any ideas on how I could debug this? Thanks! 回答1: Have you started

Monit Ruby on Rails Sidekiq

∥☆過路亽.° 提交于 2019-12-07 02:23:07
问题 I'm trying to set up Monit for Sidekiq. Here's what I have so far for my config file: check process sidekiq_site with pidfile /var/www/site/tmp/pids/sidekiq.pid start program = "bundle exec sidekiq -C /var/www/site/config/sidekiq.yml -P /var/www/site/tmp/pids/sidekiq.pid" with timeout 90 seconds if totalmem is greater than 200 MB for 2 cycles then restart # eating up memory? group site_sidekiq The problem is I'm getting a message when I run monit reload that the program "bundle" does not

Releasing ActiveRecord connection before the end of a Sidekiq job

时间秒杀一切 提交于 2019-12-06 12:11:40
问题 This question deals with matters of performance and optimization with the way one can implement Sidekiq jobs. Suppose we have the following job workflow def perform # Step 1 do_things_with_activerecord_db_and_get_some_parameters() # Step 2 step2_perform_an_http_request_with_these_parameters_on_unreliable_server() end In the following case, an ActiveRecord connection is taken from the pool at Step 1, and will only be released by SideKiq after job has completed (or failed) by the ActiveRecord