{"action":"created","issue":{"url":"https://api.github.com/repos/ondrejbartas/sidekiq-cron/issues/55","labels_url":"https://api.github.com/repos/ondrejbartas/sidekiq-cron/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/ondrejbartas/sidekiq-cron/issues/55/comments","events_url":"https://api.github.com/repos/ondrejbartas/sidekiq-cron/issues/55/events","html_url":"https://github.com/ondrejbartas/sidekiq-cron/issues/55","id":97983917,"number":55,"title":"Do not enqueue if job is in queue or is currently processing","user":{"login":"ondrejbartas","id":45809,"avatar_url":"https://avatars.githubusercontent.com/u/45809?v=3","gravatar_id":"","url":"https://api.github.com/users/ondrejbartas","html_url":"https://github.com/ondrejbartas","followers_url":"https://api.github.com/users/ondrejbartas/followers","following_url":"https://api.github.com/users/ondrejbartas/following{/other_user}","gists_url":"https://api.github.com/users/ondrejbartas/gists{/gist_id}","starred_url":"https://api.github.com/users/ondrejbartas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ondrejbartas/subscriptions","organizations_url":"https://api.github.com/users/ondrejbartas/orgs","repos_url":"https://api.github.com/users/ondrejbartas/repos","events_url":"https://api.github.com/users/ondrejbartas/events{/privacy}","received_events_url":"https://api.github.com/users/ondrejbartas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-07-29T17:11:44Z","updated_at":"2015-10-29T18:48:44Z","closed_at":null,"body":"@matthuhiggins has in his fork very interesting idea.\r\n\r\n(https://github.com/matthuhiggins/sidekiq-cron/tree/singleton-cron)\r\n\r\nThis enables to say, hey I do not need to add new job if job is already in queue or currently processing.\r\n\r\nIt is remembering last enqueued job id and then when time comes and new job should be enqueued it is looking to queues and currently working sidekiq workers if it is there."},"comment":{"url":"https://api.github.com/repos/ondrejbartas/sidekiq-cron/issues/comments/152284744","html_url":"https://github.com/ondrejbartas/sidekiq-cron/issues/55#issuecomment-152284744","issue_url":"https://api.github.com/repos/ondrejbartas/sidekiq-cron/issues/55","id":152284744,"user":{"login":"barkerja","id":6124,"avatar_url":"https://avatars.githubusercontent.com/u/6124?v=3","gravatar_id":"","url":"https://api.github.com/users/barkerja","html_url":"https://github.com/barkerja","followers_url":"https://api.github.com/users/barkerja/followers","following_url":"https://api.github.com/users/barkerja/following{/other_user}","gists_url":"https://api.github.com/users/barkerja/gists{/gist_id}","starred_url":"https://api.github.com/users/barkerja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barkerja/subscriptions","organizations_url":"https://api.github.com/users/barkerja/orgs","repos_url":"https://api.github.com/users/barkerja/repos","events_url":"https://api.github.com/users/barkerja/events{/privacy}","received_events_url":"https://api.github.com/users/barkerja/received_events","type":"User","site_admin":false},"created_at":"2015-10-29T18:48:44Z","updated_at":"2015-10-29T18:48:44Z","body":"Couldn't you simply use Redis to act as a global semaphore? Run a lock check in the method executing the job, if the lock exists, simply return without executing the job. You of course would want a reasonable timeout in the case the job fails and is unable to release the lock."}}