Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8551725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:15:30+00:00 2026-06-11T14:15:30+00:00

I am facing a very interesting problem. I have tested the Delay job gem

  • 0

I am facing a very interesting problem. I have tested the Delay job gem 4 times. I doubt it is the design problem of the gem or a bug. I use command rake jobs:work to create worker to do delayed job.

Once I create a LongTask record, i also make a delayed job which will change the attributeminutes_delayed to 2.

The gem works perfectly if I don’t update the attributes. But once I edited the description, the gem will not work properly, which means it will not execute the delayed job, but the related delayed job record will be removed in the database.

Interesting final result:
enter image description here

It Seems to reference a object with attribute that is exactly the same, this picture was captured before the running time have gone over.
it seems to reference a object with attribute that is exactly the same

This one was captured after all tests have been gone though. You can see the delayed job record for test4 have been removed even this delayed job did’t have any effect.
enter image description here

terminal results (only 2 jobs are executed)

[Worker(host:Jasonteki-MacBook-Air.local pid:1726)] Starting job worker
[Worker(host:Jasonteki-MacBook-Air.local pid:1726)] LongTask#set_delay_time_without_delay completed after 0.0343
[Worker(host:Jasonteki-MacBook-Air.local pid:1726)] 1 jobs processed at 16.6270 j/s, 0 failed ...
[Worker(host:Jasonteki-MacBook-Air.local pid:1726)] LongTask#set_delay_time_without_delay completed after 0.0105
[Worker(host:Jasonteki-MacBook-Air.local pid:1726)] 1 jobs processed at 51.4774 j/s, 0 failed ...

Code in model:

  def set_delay_time(time)
    self.minutes_delayed = time
    # very important for this, otherwise cannot write the change into the database
    self.save
  end

  handle_asynchronously :set_delay_time, :run_at => Proc.new { 2.minutes.from_now }

Code in controller:

 def create
    @long_task = LongTask.new(params[:long_task])

    respond_to do |format|
      if @long_task.save
        @long_task.set_delay_time(2)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T14:15:31+00:00Added an answer on June 11, 2026 at 2:15 pm

    Without seeing your code, it’s impossible to tell for sure, but it’s likely that both of your delayed jobs are working on serialized copies of your object, rather than reloading them from the database.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am facing a very strange problem. I have a grid and when i
I am facing a very annoying problem. I have written (in Notepad++) some SQL
I am facing a really very interesting problem with string. My code is: Dim
I'm facing a very annoying problem. Here's the context : I have a rectangle
I'm facing a very strange bug with the make_voteable gem. Actually I'm not even
I facing very huge problem now, that is I have usercontrol (created by me)
I am facing this very weird problem, I have created a custom UITableViewCell on
I am facing very strange problem in which I have byte[] and when I
I am facing very strange problem. After debugging from my side, I thought to
I am facing a very strange problem where the same loop keeps giving me

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.