sidekiq

Controller can't find object created by worker

假如想象 提交于 2020-02-06 05:49:05
问题 Spent all day trying to fix this.. Basically the controller is calling worker to perform the creation of "Balance". The worker performs with success and the record is created but when it returns to the controller it can't find the object created. How to force it looking for the "updated database" records ? Controller: balance = BalanceCreator.perform_async(userx.id, market.id) 20.times do status = Sidekiq::Status::get balance, :exp_status if ["done"].include?(status) break end sleep(0.2) end

Sidekiq Broken Pipe Error

只谈情不闲聊 提交于 2020-01-15 10:43:15
问题 I am attempting to migrate from Heroku to AWS, but my Sidekiq jobs keep failing with the following error: Errno::EPIPE: Broken pipe @ io_write - <STDOUT> I can successfully run jobs from the console using perform_now , and everything works just fine in Heroku, so I am presuming the issue lies somewhere with my AWS setup. I have seen references to improper daemonization around Stack Overflow and Github but not sure how to solve the problem. Right now I am launching my processes with the

How to find failed jobs list in sidekiq?

末鹿安然 提交于 2020-01-13 08:33:28
问题 I am using sidekiq in rails4 . How can I find failed jobs list and reprocesses them to perform in sidekiq ? 回答1: See Sidekiq::RetrySet in sidekiq/api https://github.com/mperham/sidekiq/wiki/API#retries 回答2: Try sidekiq-failures , I believe that is what you want. https://github.com/mhfs/sidekiq-failures 来源: https://stackoverflow.com/questions/23608052/how-to-find-failed-jobs-list-in-sidekiq

Errno::EIO: Input/output error - <STDOUT>

扶醉桌前 提交于 2020-01-13 08:15:02
问题 class FaxFetchWorker include Sidekiq::Worker sidekiq_options :retry => false def perform(job_id=0) logger.warn "perform is invoked." FaxSource.all.each do |source| ... end end end Getting Error Errno::EIO: Input/output error - <STDOUT> on Line # 6 回答1: The #6 line in your code is this logger.warn "perform is invoked." This code needs opened STDOUT stream and your error name is Errno::EIO . In linux EIO means, that there was made an attempt to read/write to stream which is currently

Errno::EIO: Input/output error - <STDOUT>

不羁岁月 提交于 2020-01-13 08:14:37
问题 class FaxFetchWorker include Sidekiq::Worker sidekiq_options :retry => false def perform(job_id=0) logger.warn "perform is invoked." FaxSource.all.each do |source| ... end end end Getting Error Errno::EIO: Input/output error - <STDOUT> on Line # 6 回答1: The #6 line in your code is this logger.warn "perform is invoked." This code needs opened STDOUT stream and your error name is Errno::EIO . In linux EIO means, that there was made an attempt to read/write to stream which is currently

Redistogo and Sidekiq on Heroku: Can't connect

坚强是说给别人听的谎言 提交于 2020-01-10 18:55:33
问题 I had huge issues with starting sidekiq on Heroku after updating my gems and putting everything into production. The problem was that Sidekiq tried to connect to Redis on a local connection and port, instead of using the REDISTOGO variable. After spending a few hours, I managed to fix it: Answer below. 回答1: Remove everything from the if and below and run this: heroku config:set REDIS_PROVIDER=REDISTOGO_URL Sidekiq will automatically use it. 回答2: I looked up the correct, new connection that

Sidekiq work conditions

时光怂恿深爱的人放手 提交于 2020-01-06 02:30:46
问题 On my application I have 25 workers that are randomly used by different users' actions. Only one simultaneous (active / busy) work is allowed by each user. It can't be blocked on the controller because the idea is not to block the action creation. Actions need to be created but hold in line till all previos requests by the same user are processed and only after that a worker will be (re)-assigned for the same user. If another user, in the meantime, requests a job creation, it should start

Handle exception in Sidekiq 3 jobs

落花浮王杯 提交于 2020-01-04 13:26:13
问题 I am using Sidekiq 3 in my ruby on rails 3.2 application. How can I handle exception in Sidekiq jobs without plugin (for example: Honeybadger, Airbrake, Rollbar, BugSnag). I want to catch exception that occurs in the job. 回答1: Bugsnag actually comes with built-in support for catching errors in both Sidekiq 2 and 3, so it will automatically detect any exceptions in your sidekiq jobs! 来源: https://stackoverflow.com/questions/24269388/handle-exception-in-sidekiq-3-jobs

Carrierwave processed images not uploading to AWS S3

两盒软妹~` 提交于 2020-01-03 03:43:12
问题 Similar problem to this question but the solution provided did not fix my problem. Carrierwave processed images not uploading to S3 Using Railscast #383 as basis for code: http://railscasts.com/episodes/383-uploading-to-amazon-s3 The image is successfully uploaded to S3 using carrierwave_direct. I want to process the images in the background with sidekiq and then upload to S3. The sidekiq worker completes the image processing without error but the processed images (:thumb and :large) are

how to reload page after uploading images

我与影子孤独终老i 提交于 2020-01-03 03:25:07
问题 I use gem 'jquery-fileupload-rails' and 'carrierwave_backgrounder' gem with sidekiq. How to add reload the page after download is complete? The problem is that the download is in the background and the page is reloaded immediately, not when the images loaded fileupload.js $(function () { $('#new_photo').fileupload({ acceptFileTypes: '/(\.|\/)(gif|jpe?g|png)$/i', dataType: 'html', add: function (e, data) { data.context = $('#loading').css({display:"block"}).appendTo('#photos'); data.submit();