{"action":"created","issue":{"url":"https://api.github.com/repos/timgit/pg-boss/issues/8","repository_url":"https://api.github.com/repos/timgit/pg-boss","labels_url":"https://api.github.com/repos/timgit/pg-boss/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/timgit/pg-boss/issues/8/comments","events_url":"https://api.github.com/repos/timgit/pg-boss/issues/8/events","html_url":"https://github.com/timgit/pg-boss/issues/8","id":193464515,"number":8,"title":"Support for querying jobs table to prevent duplicate jobs","user":{"login":"ranyefet","id":1016375,"avatar_url":"https://avatars.githubusercontent.com/u/1016375?v=3","gravatar_id":"","url":"https://api.github.com/users/ranyefet","html_url":"https://github.com/ranyefet","followers_url":"https://api.github.com/users/ranyefet/followers","following_url":"https://api.github.com/users/ranyefet/following{/other_user}","gists_url":"https://api.github.com/users/ranyefet/gists{/gist_id}","starred_url":"https://api.github.com/users/ranyefet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ranyefet/subscriptions","organizations_url":"https://api.github.com/users/ranyefet/orgs","repos_url":"https://api.github.com/users/ranyefet/repos","events_url":"https://api.github.com/users/ranyefet/events{/privacy}","received_events_url":"https://api.github.com/users/ranyefet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-05T10:46:35Z","updated_at":"2016-12-05T19:57:11Z","closed_at":null,"body":"Hello,\r\n\r\nThis looks like a nice library.\r\nMy use case is the following, I like to schedule a single message every 24 hours for active users.\r\nMeaning if user came to the app and did some action, I like to schedule a message that will be sent to the user in 24 hours.\r\n\r\nBut I only want to have a single schedule message for every user in a 24 hour duration.\r\n\r\nI was thinking querying the jobs table before creating a job, but I wonder if there's a better way?\r\n\r\nThanks,\r\nRan.\r\n"},"comment":{"url":"https://api.github.com/repos/timgit/pg-boss/issues/comments/264959462","html_url":"https://github.com/timgit/pg-boss/issues/8#issuecomment-264959462","issue_url":"https://api.github.com/repos/timgit/pg-boss/issues/8","id":264959462,"user":{"login":"timgit","id":656974,"avatar_url":"https://avatars.githubusercontent.com/u/656974?v=3","gravatar_id":"","url":"https://api.github.com/users/timgit","html_url":"https://github.com/timgit","followers_url":"https://api.github.com/users/timgit/followers","following_url":"https://api.github.com/users/timgit/following{/other_user}","gists_url":"https://api.github.com/users/timgit/gists{/gist_id}","starred_url":"https://api.github.com/users/timgit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timgit/subscriptions","organizations_url":"https://api.github.com/users/timgit/orgs","repos_url":"https://api.github.com/users/timgit/repos","events_url":"https://api.github.com/users/timgit/events{/privacy}","received_events_url":"https://api.github.com/users/timgit/received_events","type":"User","site_admin":false},"created_at":"2016-12-05T19:57:11Z","updated_at":"2016-12-05T19:57:11Z","body":"Hey Ran.  Yes, you could use a combination of the delay and throttling configuration to do this, but in the process of writing a test for this use case, I discovered something in the throttling logic that would cause your use case to get 1 extra email.  So, for now, know that I intended for this use case to work, but give me a day or so to get a patch pushed to address it.\r\n\r\nFor example,\r\n\r\n```js\r\npgboss.publish('userActionEmail', actionPayload, { startIn: '24 hours', singletonHours: 24});\r\n```"}}
{"actor":{"display_login":"timgit"}}