{"action":"created","issue":{"url":"https://api.github.com/repos/mperham/sidekiq/issues/2658","labels_url":"https://api.github.com/repos/mperham/sidekiq/issues/2658/labels{/name}","comments_url":"https://api.github.com/repos/mperham/sidekiq/issues/2658/comments","events_url":"https://api.github.com/repos/mperham/sidekiq/issues/2658/events","html_url":"https://github.com/mperham/sidekiq/issues/2658","id":116813441,"number":2658,"title":"Enterprise: Unable to bypass `unique_for`","user":{"login":"RobinDaugherty","id":1005280,"avatar_url":"https://avatars.githubusercontent.com/u/1005280?v=3","gravatar_id":"","url":"https://api.github.com/users/RobinDaugherty","html_url":"https://github.com/RobinDaugherty","followers_url":"https://api.github.com/users/RobinDaugherty/followers","following_url":"https://api.github.com/users/RobinDaugherty/following{/other_user}","gists_url":"https://api.github.com/users/RobinDaugherty/gists{/gist_id}","starred_url":"https://api.github.com/users/RobinDaugherty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobinDaugherty/subscriptions","organizations_url":"https://api.github.com/users/RobinDaugherty/orgs","repos_url":"https://api.github.com/users/RobinDaugherty/repos","events_url":"https://api.github.com/users/RobinDaugherty/events{/privacy}","received_events_url":"https://api.github.com/users/RobinDaugherty/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-13T17:33:43Z","updated_at":"2015-11-13T17:55:19Z","closed_at":"2015-11-13T17:53:04Z","body":"According to [the doc](https://github.com/mperham/sidekiq/wiki/Ent-Unique-Jobs#bypassing-uniqueness) (and also the doc block in `unique.rb`), we should be able to bypass a job's `unique_for` setting by adding `unique_for: false`. I just ran into an issue where we had to requeue some items, and I couldn't because of the unique constraint.\r\n\r\nI tried to use the following:\r\n\r\n```ruby\r\nSidekiq::Client.push('class' => 'IndexUpdatingWorker', 'args' => [klass, ids], 'unique_for' => false)\r\n```\r\n\r\nand got\r\n\r\n```\r\nNoMethodError: undefined method `to_i' for false:FalseClass\r\nfrom /data/aperture/releases/20151113030912/vendor/bundle/ruby/2.2.0/gems/sidekiq-ent-0.7.5/lib/sidekiq-ent/unique.rb:64:in `call'\r\n```\r\n\r\nLooking at the code, I thought maybe this would work:\r\n\r\n```ruby\r\nSidekiq::Client.push('class' => 'IndexUpdatingWorker', 'args' => [klass, ids], 'unique_for' => 0)\r\n```\r\n\r\nbut I then got\r\n\r\n```\r\nRedis::CommandError: ERR invalid expire time in SETEX\r\nfrom /data/aperture/releases/20151113030912/vendor/bundle/ruby/2.2.0/gems/redis-3.2.1/lib/redis/client.rb:113:in `call'\r\n```\r\n\r\nI'm at a loss. It seems that the documentation is wrong, but I don't have a better answer.\r\n\r\nTo solve this, I would settle for a way to add the jobs while bypassing uniqueness, or a way to reset and clear out the list of unique hashes."},"comment":{"url":"https://api.github.com/repos/mperham/sidekiq/issues/comments/156501138","html_url":"https://github.com/mperham/sidekiq/issues/2658#issuecomment-156501138","issue_url":"https://api.github.com/repos/mperham/sidekiq/issues/2658","id":156501138,"user":{"login":"mperham","id":2911,"avatar_url":"https://avatars.githubusercontent.com/u/2911?v=3","gravatar_id":"","url":"https://api.github.com/users/mperham","html_url":"https://github.com/mperham","followers_url":"https://api.github.com/users/mperham/followers","following_url":"https://api.github.com/users/mperham/following{/other_user}","gists_url":"https://api.github.com/users/mperham/gists{/gist_id}","starred_url":"https://api.github.com/users/mperham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mperham/subscriptions","organizations_url":"https://api.github.com/users/mperham/orgs","repos_url":"https://api.github.com/users/mperham/repos","events_url":"https://api.github.com/users/mperham/events{/privacy}","received_events_url":"https://api.github.com/users/mperham/received_events","type":"User","site_admin":false},"created_at":"2015-11-13T17:55:19Z","updated_at":"2015-11-13T17:55:19Z","body":"0.7.8 is now available with this fix."}}