Giter Club home page Giter Club logo

Comments (10)

cmer avatar cmer commented on August 17, 2024

I updated to 2.3.2 and I still have the same problem... Any idea what might be wrong? It's kind of a show-stopper for me unfortunately.

Thanks!

from sidekiq-unique-jobs.

mhenrixon avatar mhenrixon commented on August 17, 2024

Real sorry you are having that problem still! Uniqueness should have been added automagically. Any chance you could share the project with us or if that isn't possible could you try and replicate the problem in a fresh repo?

from sidekiq-unique-jobs.

cmer avatar cmer commented on August 17, 2024

Thanks for caring. I put together a small project that reproduces the problem.

Just run bundle and rake spec.

https://dl.dropbox.com/u/132165/unique-job-bug.zip

I also ran into another issue I haven't seen before, but I wonder if it's a Sidekiq but rather than a unique-jobs bug. I marked that test as "pending".

from sidekiq-unique-jobs.

mhenrixon avatar mhenrixon commented on August 17, 2024

It's obviously getting late, I started running tests instead of specs. I'll be back

from sidekiq-unique-jobs.

mperham avatar mperham commented on August 17, 2024

Are you sure that middleware is executed in the tests? I'm not sure it is.

from sidekiq-unique-jobs.

cmer avatar cmer commented on August 17, 2024

FYI I just realized that in my spec file, I try to queue a whole activerecord object. The problem still persists when I replace the object with a simple string such as 'abc'.

NotificationPushWorker.perform_in(5.minutes, 'abc')

from sidekiq-unique-jobs.

mhenrixon avatar mhenrixon commented on August 17, 2024

Yup mike is right, to test this you would need to test against a real redis since the sidekiq/test doesn't take into consideration any middleware, it just pushes everything to jobs array without hesitation.

before {
  Sidekiq.redis = REDIS
  Sidekiq.redis {|c| c.flushdb }
}

it "does not store duplicate jobs" do
  3.times {
    Sidekiq::Client.push('class' => NotificationPushWorker, 'queue' => 'notification_push',  'args' => notification.id)
  }
  Sidekiq.redis { |c| c.llen('queue:notification_push') }.should eql 1
end

Really not ideal agreeably, I'll see if I can add some sort of hook for testing this in a client app.

from sidekiq-unique-jobs.

cmer avatar cmer commented on August 17, 2024

Ah! So basically, you're saying that my tests fail but that in real life, it should just work?

I guess I'll test with the workaround for now. Thanks!

from sidekiq-unique-jobs.

davidcelis avatar davidcelis commented on August 17, 2024

I can confirm via playing around on my own apps that the middleware does work and get executed. My jobs are unique, but I agree that not seeing it show up in the client middleware stack was confusing. I'm just glad this is working.

from sidekiq-unique-jobs.

mhenrixon avatar mhenrixon commented on August 17, 2024

Awesome :)

from sidekiq-unique-jobs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.