sidekiq

dump elasticsearch 2.x to mongodb and back to ES 6.x

那年仲夏 提交于 2019-12-10 17:27:17
问题 This question is more of theoretical than source code. I have a ES 2.x node which has more than 1.2TB data. We have 40+ indices with each having at-least 1 type. Here, ES 2.x is used as a database rather than as a search engine. The source which was used to dump data into ES 2.x is lost. Also, data is not normalised but a single ES document has multiple embedded documents. Our aim is to recreate the data source and at the same time to normalise it. What we are planning is: Retrieve data from

Rails ActiveJob - What's the good way to handle exception in ActionMailer::DeliveryJob

 ̄綄美尐妖づ 提交于 2019-12-10 16:38:11
问题 I am using ActiveJob + Sidekiq in my Rails project for task processing. I send my mails directly using MyMailer.some.deliver_later . It will automatically creates a ActionMailer::DeliveryJob task and put it in the Sidekiq queue. The question is, what's the good to handle exceptions from there? Best Regards. 回答1: According to http://edgeguides.rubyonrails.org/active_job_basics.html, I think the good way is to setup exception error handlers for ActionMailer::DeliveryJob in an initializer,

Using Sidekiq for Active Job and getting ActiveJob::DeserializationError

别说谁变了你拦得住时间么 提交于 2019-12-10 14:21:42
问题 I'm trying to use Sidekiq to run the below job. The job performs fine when not queued (perform_now) but fails when called as (perform_later), which uses Sidekiq. AddEmployeesToRoomJob.perform_now room ## works fine AddEmployeesToRoomJob.perform_later room ## breaks in Sidekiq Error: AddEmployeesToRoomJob JID-da24b13f405b1ece1212bbd5 INFO: fail: 0.003 sec 2016-08-20T14:57:16.645Z 19456 TID-owmym5fbk WARN: {"class":"ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper","wrapped" :

Sidekiq server not loading configuration file

流过昼夜 提交于 2019-12-10 13:55:30
问题 I'm trying to setup sidekiq with my sinatra application, and I'm having trouble starting up the sidekiq workers to run in the daemon mode, with a configuration file. My project has the following structure: project - config -- sidekiq.yml #Sidekiq Config File - app -- app.rb #Sinatra Application File - Rakefile - Gemfile - etc. The ultimate goal is to create some rake tasks to handle all sidekiq tasks. For now, I'm just trying to the get things to work correctly via the command line, and then

Limit number of threads per sidekiq queue

落爺英雄遲暮 提交于 2019-12-10 11:40:53
问题 Is there a way for me to limit the number of maximum threads per sidekiq queue? For example: We have a daily job that takes quite a lot of time to get processed. On the one hand we can say let's put 20 threads and get it done faster. Well, no - that clogs up our database. What I want is to have something similar to: DailyJobsQueue - 10 threads max, regularJobsQueue - no limit of threads (the rest of available threads - not to say they will be used not in peak times). I've seen I can give

Get error message out of Sidekiq job

帅比萌擦擦* 提交于 2019-12-10 11:01:35
问题 I want to get exception error message out of the sidekiq job. when I set back_trace option to true it retries my job but I want to exit from job when error raises and get error message. if I find that process ended successful or fail is enough. def perform(text) begin fail StandardError, 'Error!' rescue fail 'EEE' # I want to get this error when call job end end # call NormalJob.perform_async('test') # I want to get error here after call 回答1: If I were you I would try gem sidekiq-status. It

Efficiently reschedule ActiveJob (resque/sidekiq)

帅比萌擦擦* 提交于 2019-12-09 13:50:03
问题 I'm playing with Rails 4.2 app which uses ActiveJob backed by resque/sidekiq for email scheduling. When a user creates newsletter campaign a new job is created and scheduled on certain date. That's all great but what happens when the user changes the delivery date. In this case every job could check if it should be delivered or not thus invalid jobs would be ignored and only the last one would be executed. This could work but if a user would make 1k edits that would push 1k-1 invalid jobs

Jobs processing in background from web application

一个人想着一个人 提交于 2019-12-09 06:09:16
问题 I want to schedule and run a lot of jobs in the background during a web application execution. The web app is built on top of Symfony 2 and Doctrine 2. I know the job-processing can be done with libraries like Resque or Sidekiq. However, these libraries and my application are written in different languages, so I am wondering how I can run Sidekiq jobs written in Ruby which should integrate with my app written in PHP. What I'm asking myself is if the only way to do this is rewriting a large

How get best performance rails requests parallel sidekiq worker

ε祈祈猫儿з 提交于 2019-12-09 01:48:50
问题 My rails app have one sidekiq worker. The worker will do 2500 requests to a api external, the response is a xml. How get best performance for this worker? 回答1: Inside the worker, spawn application level Threads. For example, Create 10 ruby threads to process the 2500 external api requests(means each ruby thread will process 250 requests). # threads will contain the threads threads = [] external_requests.each_slice(250) do |group| threads << Thread.new(group) do |tsrc| tsrc.each do |ex_request

Rails, Sidekiq - Redis NOAUTH

雨燕双飞 提交于 2019-12-08 17:32:07
问题 I use sidekiq on rails for sending out emails. I've added a password for the redis server but cant seem to get it right because I get an error D, [2015-12-10T16:49:52.714279 #10497] DEBUG -- : (0.5ms) COMMIT I, [2015-12-10T16:49:52.720380 #10497] INFO -- : [ActiveJob] Enqueued ActionMailer::DeliveryJob (Job ID: 5bce215c-7649-4774-8c6e-d29e743cf25e) to Sidekiq(mailers) with arguments: "MessageMailer", "new_message", "deliver_now", gid://customer-app/Message/18 I, [2015-12-10T16:49:52.723400