delayed-job

How to reproduce/sanitize messy POST params to avoid YAML serialization issues with delayed_job?

寵の児 提交于 2019-12-02 04:42:51
问题 Today, every time I was starting delayed_job workers, the process would die immediately and silently. After some investigation (and finding out about the foreground mode of delayed_job ), I finally found out the problem was the way delayed_job had serialized my active record object was triggering an exception on the YAML load part: Psych::SyntaxError: (<unknown>): mapping keys are not allowed in this context at line 7 column 14 from /Users/mick/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/psych

delayed_job queue not being processed on Heroku

拈花ヽ惹草 提交于 2019-12-02 02:14:28
I'm running a Rails 3 app with delayed_job. The issue I've come across is that though the app is correctly adding jobs to the queue, they are never being processed. My Class class User < ActiveRecord::Base after_create :send_welcome_email private def send_welcome_email UserMailer.delay.welcome_email(self) end end Inspecting things through the Rails console I can see that there are jobs in the queue. I can also see that there have been 0 attempts to perform the jobs. Spinning up a Heroku worker doesn't cause the jobs to be processed. Any ideas? Thanks! Edit: Trying to clear the jobs queue as

How to reproduce/sanitize messy POST params to avoid YAML serialization issues with delayed_job?

喜欢而已 提交于 2019-12-02 01:42:26
Today, every time I was starting delayed_job workers, the process would die immediately and silently. After some investigation (and finding out about the foreground mode of delayed_job ), I finally found out the problem was the way delayed_job had serialized my active record object was triggering an exception on the YAML load part: Psych::SyntaxError: (<unknown>): mapping keys are not allowed in this context at line 7 column 14 from /Users/mick/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/psych.rb:203:in `parse' from /Users/mick/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/psych.rb:203:in `parse

How to Delay MessageDialogBox in Java?

天涯浪子 提交于 2019-12-02 00:04:34
问题 So in this chunk of code: //Actions performed when an event occurs. public void actionPerformed(ActionEvent event) { String command = event.getActionCommand(); //If btnConvertDocuments is clicked, the FileConverter method is called and the button is then disabled [so as to prevent duplicates]. if (command.equals("w")) { new Thread(new Runnable() { public void run() { FileConverter fc = new FileConverter(); } }).start(); btnConvertDocuments.setEnabled(false); //Validation message ensuring

How to Delay MessageDialogBox in Java?

╄→гoц情女王★ 提交于 2019-12-01 22:42:57
So in this chunk of code: //Actions performed when an event occurs. public void actionPerformed(ActionEvent event) { String command = event.getActionCommand(); //If btnConvertDocuments is clicked, the FileConverter method is called and the button is then disabled [so as to prevent duplicates]. if (command.equals("w")) { new Thread(new Runnable() { public void run() { FileConverter fc = new FileConverter(); } }).start(); btnConvertDocuments.setEnabled(false); //Validation message ensuring completion of the step. JOptionPane.showMessageDialog(this, "Step 1 Complete!", "Validation", JOptionPane

Delayed Jobs and Action Mailer

冷暖自知 提交于 2019-12-01 21:18:52
问题 I am having trouble with implementing delayed jobs with my ActionMailer: Before Delayed Job Implementation: class NotificationsMailer < ActionMailer::Base default :from => "noreply@mycompany.com" default :to => "info@mycompany.com" def new_message(message) @message = message mail(:subject => "[Company Notification] #{message.subject}") end end and called it using this line (it worked perfectly fine): NotificationsMailer.new_message(@message).deliver After the Delayed Job implementation all i

Delayed Jobs and Action Mailer

江枫思渺然 提交于 2019-12-01 19:03:45
I am having trouble with implementing delayed jobs with my ActionMailer: Before Delayed Job Implementation: class NotificationsMailer < ActionMailer::Base default :from => "noreply@mycompany.com" default :to => "info@mycompany.com" def new_message(message) @message = message mail(:subject => "[Company Notification] #{message.subject}") end end and called it using this line (it worked perfectly fine): NotificationsMailer.new_message(@message).deliver After the Delayed Job implementation all i did was change the deliver line to: NotificationsMailer.delay.new_message(@message) In addition, I

Why is the timezone off in delayed_job?

爱⌒轻易说出口 提交于 2019-12-01 18:15:45
In my Rails app, when I create a background job using the delayed_job gem, I get all times offset by 6 hours. My understanding is that delayed_job uses your timezone , but it's like it's using the wrong one. Instead of being -6 hours from UTC ( CST is my time zone), it's -12 hours! Here's a bit of view code to illustrate. Note: Time.now gives 2014-03-04 23:26:55 -0600 Time.now.utc gives 2014-03-05 05:26:55 UTC but delayed_job's idea of just a few seconds ago is 2014-03-04 17:26:53 -0600 My View: #delayed_jobs/index.html.erb <h1>All Background Jobs</h1> <p>The time now is: <%= Time.now %> </p>

YAML - TypeError: can't dump anonymous module

元气小坏坏 提交于 2019-12-01 17:44:57
问题 In an action of application_controller, if we try: p request.env.to_yaml I will got this error: TypeError: can't dump anonymous module: #<Module:0x007fee26e34ad8> from /Users/twer/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:267:in `visit_Module' from /Users/twer/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:102:in `accept' from /Users/twer/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:447:in `block in dump_ivars'

Why is the timezone off in delayed_job?

℡╲_俬逩灬. 提交于 2019-12-01 17:29:28
问题 In my Rails app, when I create a background job using the delayed_job gem, I get all times offset by 6 hours. My understanding is that delayed_job uses your timezone, but it's like it's using the wrong one. Instead of being -6 hours from UTC (CST is my time zone), it's -12 hours! Here's a bit of view code to illustrate. Note: Time.now gives 2014-03-04 23:26:55 -0600 Time.now.utc gives 2014-03-05 05:26:55 UTC but delayed_job's idea of just a few seconds ago is 2014-03-04 17:26:53 -0600 My View