Skip to content

Unique jobs do not work with ActiveJob #56

@lucasteligioridis

Description

@lucasteligioridis

Trying to do the below task in order to create unique jobs, as per:
https://github.com/contribsys/faktory/wiki/Pro-Unique-Jobs

My job classes look something like:

class FaktoryJob < ActiveJob::Base
  self.queue_adapter = :faktory
  queue_as 'default'
end

class SleepJob < FaktoryJob
  faktory_options custom: { unique_for: 5 }

  def perform
    sleep 10.seconds
  end
end

It seems that there might be an issue with the custom object being passed in correctly utilising ActiveJob vs native Faktory::Jobs
As you can see two identical jobs are enqueued immediately after one another:

Screen Shot 2021-04-12 at 8 41 48 am

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions