sidekiq

sidekiq_mailer error when trying to send email

孤街浪徒 提交于 2019-12-12 21:33:33
问题 I added to my app the gems sidekiq (2.15.0) and sidekiq_mailer (0.0.6). When I try to send an email, I receive: NoMethodError (undefined method `key?' for #<JSON::Ext::Generator::State:0x007f1b...... Does anybody have any idea why that is the case? 回答1: Per this comment on a resque issue I was able to solve a similar issue where I was trying to pass an entire object to the worker's perform action instead of just the object id. I refactored my code to pass just an id and fetch the necessary

Is ruby 2.1.2 timeout still not thread safe?

时间秒杀一切 提交于 2019-12-12 12:14:31
问题 I have 50 sidekiq threads crawling the web, and a few weeks ago the threads started hanging after about 20 minutes of running. When I do a backtrace dump, most of the threads are stuck on net/http initialize: /app/vendor/ruby-2.1.2/lib/ruby/2.1.0/net/http.rb:879:in `initialize' /app/vendor/ruby-2.1.2/lib/ruby/2.1.0/net/http.rb:879:in `open' /app/vendor/ruby-2.1.2/lib/ruby/2.1.0/net/http.rb:879:in `block in connect' /app/vendor/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb:76:in `timeout' /app/vendor

How to push job in specific queue and limit number workers with sidekiq?

筅森魡賤 提交于 2019-12-12 10:45:57
问题 I know we can do: sidekiq_options queue: "Foo" But in this case it's the Worker which is assigned to only one queue: "Foo". I need to assign a Job (and not a Worker) in specific queue. With Resque it's easy: Resque.enqueue_to(queue_name, my_job) Further, for concurrency problem, i need to limit the number of Worker on each queue at 1. How can I do this? 回答1: You might use https://github.com/brainopia/sidekiq-limit_fetch and then: Sidekiq::Client.push({ 'class' => GuidePdfWorker, 'queue' =>

How to perform a Sidekiq callback when a group of workers are complete

 ̄綄美尐妖づ 提交于 2019-12-12 08:48:52
问题 Lets say I have a Sidekiq task that processes products to my database. Each product is grouped by store, so an overly simplified example of my code would be something like this... stores.each do |store| store.products.each do |product| ProductWorker.perform_async(product.id) end end When all the products from one store have run. I'd like to update the stores last_updated column with the current time. But only when the last task for that store has run. How can I achieve this? 回答1: This is

GitLab email notifications not sending

你。 提交于 2019-12-12 07:29:22
问题 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:/

Sidekiq Pro callback when batch is retried?

耗尽温柔 提交于 2019-12-12 05:38:57
问题 I'm using sidekiq pro for my application, and it's been working great. But I'd like to have a way to notify my users that a failed job is being retried. A flow would go something like this: Batch starts worker1 runs successfully worker2 runs successfully worker3 fails oncomplete fires, stuff happens worker3 restarts ** onretry fires, notification sent to user worker 3 runs successfully onsuccess fires, stuff happens My imaginary onretry doesn't exist in the documentation but I'm hoping there

sidekiq taking more memory over the period? How we can solve that?

て烟熏妆下的殇ゞ 提交于 2019-12-12 04:37:43
问题 sidekiq running very long and over the period our 16GB RAM near to full. if we stop & restart the memory goes down. Our Rails App version is Rails 3.2.12 and Ruby 1.9.3 How we can resolve this? 回答1: This happened to me shortly after I deployed Sidekiq. It turns out I had a job that was running where the following happened: It would load a spreadsheet it needed to import users It was erring during the import process and dying The Sidekiq worker was set to retry the job several times Each retry

Sidekiq-like queue using java tools?

こ雲淡風輕ζ 提交于 2019-12-11 17:39:13
问题 I want to have a work queue that behaves almost exactly like ruby's sidekiq(it doesn't need to use Redis, but it can - I just can't use ruby - not even Jruby). Basically I want to be able to create jobs that runs with some parameters and a worker pool executes the jobs. The workers are going to use hibernate to do some work, so I think that Spring integration could make things easier. 回答1: Spring Integration has Redis Queue inbound and outbound channel adapters. The inbound message-driven

Sidekiq not finding records for Rails Active Job

匆匆过客 提交于 2019-12-11 16:12:11
问题 Jobs are queued on after a user is created like so in the model user.rb after_create_commit :profile_photo_job def profile_photo_job message = "Add a profile photo" ReminderJob.set(wait: 1800).perform_later(self.id.to_s, message) end reminder_job.rb class ReminderJob < ApplicationJob queue_as :default def perform(user_id, message) if user_id user = User.find(user_id) end ##sending message notification here end end However, it often throws the following error inside my sidekiq console

digital ocean manage sidekiq worker

为君一笑 提交于 2019-12-11 15:21:55
问题 I followed Properly setting up Redis and Sidekiq in production on Ubuntu 16.04 to manage sidekiq worker I created a file like touch /lib/systemd/system/sidekiq.service and added following content [Unit] Description=sidekiq After=syslog.target network.target [Service] Type=simple WorkingDirectory=/home/deploy/ezlarm-server/current ExecStart=/home/deploy/.rbenv/shims/bundle exec "sidekiq -e production" User=deploy Group=deploy UMask=0002 Environment=MALLOC_ARENA_MAX=2 RestartSec=1 Restart=on