{"action":"created","comment":{"url":"https://api.github.com/repos/eTechSolutions/Hangfire/pulls/comments/70795646","id":70795646,"diff_hunk":"@@ -341,6 +341,26 @@ public override int RemoveTimedOutServers(TimeSpan timeOut)\n                 new { timeOutAt = DateTime.UtcNow.Add(timeOut.Negate()) }));\n         }\n \n+        public override List<string> FetchAndRemoveTimedOutServers(TimeSpan timeOut)\n+        {\n+            if (timeOut.Duration() != timeOut)\n+            {\n+                throw new ArgumentException(\"The `timeOut` value must be positive.\", \"timeOut\");\n+            }\n+\n+            string query = $@\"select Id from [{nameof(_storage)}].Server where LastHeartbeat < @timeOutAt\";","path":"src/Hangfire.SqlServer/SqlServerConnection.cs","position":null,"original_position":11,"commit_id":"3a715b26665042ed7582175c427d19587ebf4a54","original_commit_id":"6ec60a2c2faab7792ea1963afd47567418ad0c53","user":{"login":"mahoneyj2","id":10708540,"avatar_url":"https://avatars.githubusercontent.com/u/10708540?v=3","gravatar_id":"","url":"https://api.github.com/users/mahoneyj2","html_url":"https://github.com/mahoneyj2","followers_url":"https://api.github.com/users/mahoneyj2/followers","following_url":"https://api.github.com/users/mahoneyj2/following{/other_user}","gists_url":"https://api.github.com/users/mahoneyj2/gists{/gist_id}","starred_url":"https://api.github.com/users/mahoneyj2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mahoneyj2/subscriptions","organizations_url":"https://api.github.com/users/mahoneyj2/orgs","repos_url":"https://api.github.com/users/mahoneyj2/repos","events_url":"https://api.github.com/users/mahoneyj2/events{/privacy}","received_events_url":"https://api.github.com/users/mahoneyj2/received_events","type":"User","site_admin":false},"body":"Just wondering why you would prefer var in this situation? Wouldn't it compile the same with string and be more consistent across SQLServerConnection.cs?","created_at":"2016-07-14T12:26:55Z","updated_at":"2016-07-14T12:26:55Z","html_url":"https://github.com/eTechSolutions/Hangfire/pull/15#discussion_r70795646","pull_request_url":"https://api.github.com/repos/eTechSolutions/Hangfire/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/eTechSolutions/Hangfire/pulls/comments/70795646"},"html":{"href":"https://github.com/eTechSolutions/Hangfire/pull/15#discussion_r70795646"},"pull_request":{"href":"https://api.github.com/repos/eTechSolutions/Hangfire/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/eTechSolutions/Hangfire/pulls/15","id":77288044,"html_url":"https://github.com/eTechSolutions/Hangfire/pull/15","diff_url":"https://github.com/eTechSolutions/Hangfire/pull/15.diff","patch_url":"https://github.com/eTechSolutions/Hangfire/pull/15.patch","issue_url":"https://api.github.com/repos/eTechSolutions/Hangfire/issues/15","number":15,"state":"open","locked":false,"title":"Email notification module","user":{"login":"Anthon123","id":19688389,"avatar_url":"https://avatars.githubusercontent.com/u/19688389?v=3","gravatar_id":"","url":"https://api.github.com/users/Anthon123","html_url":"https://github.com/Anthon123","followers_url":"https://api.github.com/users/Anthon123/followers","following_url":"https://api.github.com/users/Anthon123/following{/other_user}","gists_url":"https://api.github.com/users/Anthon123/gists{/gist_id}","starred_url":"https://api.github.com/users/Anthon123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Anthon123/subscriptions","organizations_url":"https://api.github.com/users/Anthon123/orgs","repos_url":"https://api.github.com/users/Anthon123/repos","events_url":"https://api.github.com/users/Anthon123/events{/privacy}","received_events_url":"https://api.github.com/users/Anthon123/received_events","type":"User","site_admin":false},"body":"***Email notification is not supported by ASP NET core currently***\r\n\r\nExample of setting it up in startup.cs :\r\n\r\n```\r\nList<string> toEmails = new List<string>() { \"email1@testdomain.com\" };\r\nList<string> toEmails2 = new List<string>() { \"email2@testdomain.com\" };\r\n\r\n// You can register custom configuration and email clients in the EmailNotification project. This example uses Sendgrid.\r\nSmtpConfiguration sendgridConfig = new SmtpConfiguration(\"smtp.sendgrid.net\", \"username\", \"password\", 587);\r\nSmtpClientNotifier client =  new SmtpClientNotifier(\"fromemail@testdomain.com\", \"fromname\", sendgridConfig);\r\n\r\n//Only 2 types of events for now, it is possible to create custom event types and implement detection for it in the core code.\r\nclient.Subscribe(EventTypes.Events.FailedJobPeak, toEmails);\r\nclient.Subscribe(EventTypes.Events.ServerTimeout, toEmails2);\r\n\r\nList<INotifier> clientList = new List<INotifier>();\r\nclientList.Add(client);\r\n\r\nGlobalConfiguration.Configuration.AddNotificationSystem(clientList);\r\n\r\napp.UseHangfireServer(new BackgroundJobServerOptions()\r\n{\r\n      JobCheckInterval = new TimeSpan(0, 5, 0),\r\n      JobCheckThreshold = 20,\r\n      ServerName = \"Server One\"\r\n});\r\n\r\n```\r\nThe email store can then be accessed using the static method, EmailStore.Current, in the same way as JobStorage.\r\nThis can then be used to call the NotifyAll method, which takes a EventType parameter and alerts all emails registered for that EventType in each registered client. For example,\r\n\r\n```\r\n//Server timeout detected in server watchdog\r\nEmailStore.Current.NotifyAll(EventType.Event.ServerTimeout. \"Subject\", \"Message\");\r\n```","created_at":"2016-07-13T13:25:42Z","updated_at":"2016-07-14T12:26:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b757bbaf3ccc089d63d645dab73b0d94041e9d2b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/eTechSolutions/Hangfire/pulls/15/commits","review_comments_url":"https://api.github.com/repos/eTechSolutions/Hangfire/pulls/15/comments","review_comment_url":"https://api.github.com/repos/eTechSolutions/Hangfire/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eTechSolutions/Hangfire/issues/15/comments","statuses_url":"https://api.github.com/repos/eTechSolutions/Hangfire/statuses/3a715b26665042ed7582175c427d19587ebf4a54","head":{"label":"Anthon123:NotificationModule","ref":"NotificationModule","sha":"3a715b26665042ed7582175c427d19587ebf4a54","user":{"login":"Anthon123","id":19688389,"avatar_url":"https://avatars.githubusercontent.com/u/19688389?v=3","gravatar_id":"","url":"https://api.github.com/users/Anthon123","html_url":"https://github.com/Anthon123","followers_url":"https://api.github.com/users/Anthon123/followers","following_url":"https://api.github.com/users/Anthon123/following{/other_user}","gists_url":"https://api.github.com/users/Anthon123/gists{/gist_id}","starred_url":"https://api.github.com/users/Anthon123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Anthon123/subscriptions","organizations_url":"https://api.github.com/users/Anthon123/orgs","repos_url":"https://api.github.com/users/Anthon123/repos","events_url":"https://api.github.com/users/Anthon123/events{/privacy}","received_events_url":"https://api.github.com/users/Anthon123/received_events","type":"User","site_admin":false},"repo":{"id":60179040,"name":"Hangfire","full_name":"Anthon123/Hangfire","owner":{"login":"Anthon123","id":19688389,"avatar_url":"https://avatars.githubusercontent.com/u/19688389?v=3","gravatar_id":"","url":"https://api.github.com/users/Anthon123","html_url":"https://github.com/Anthon123","followers_url":"https://api.github.com/users/Anthon123/followers","following_url":"https://api.github.com/users/Anthon123/following{/other_user}","gists_url":"https://api.github.com/users/Anthon123/gists{/gist_id}","starred_url":"https://api.github.com/users/Anthon123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Anthon123/subscriptions","organizations_url":"https://api.github.com/users/Anthon123/orgs","repos_url":"https://api.github.com/users/Anthon123/repos","events_url":"https://api.github.com/users/Anthon123/events{/privacy}","received_events_url":"https://api.github.com/users/Anthon123/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Anthon123/Hangfire","description":"An easy way to perform fire-and-forget, delayed and recurring tasks inside ASP.NET apps","fork":true,"url":"https://api.github.com/repos/Anthon123/Hangfire","forks_url":"https://api.github.com/repos/Anthon123/Hangfire/forks","keys_url":"https://api.github.com/repos/Anthon123/Hangfire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Anthon123/Hangfire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Anthon123/Hangfire/teams","hooks_url":"https://api.github.com/repos/Anthon123/Hangfire/hooks","issue_events_url":"https://api.github.com/repos/Anthon123/Hangfire/issues/events{/number}","events_url":"https://api.github.com/repos/Anthon123/Hangfire/events","assignees_url":"https://api.github.com/repos/Anthon123/Hangfire/assignees{/user}","branches_url":"https://api.github.com/repos/Anthon123/Hangfire/branches{/branch}","tags_url":"https://api.github.com/repos/Anthon123/Hangfire/tags","blobs_url":"https://api.github.com/repos/Anthon123/Hangfire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Anthon123/Hangfire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Anthon123/Hangfire/git/refs{/sha}","trees_url":"https://api.github.com/repos/Anthon123/Hangfire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Anthon123/Hangfire/statuses/{sha}","languages_url":"https://api.github.com/repos/Anthon123/Hangfire/languages","stargazers_url":"https://api.github.com/repos/Anthon123/Hangfire/stargazers","contributors_url":"https://api.github.com/repos/Anthon123/Hangfire/contributors","subscribers_url":"https://api.github.com/repos/Anthon123/Hangfire/subscribers","subscription_url":"https://api.github.com/repos/Anthon123/Hangfire/subscription","commits_url":"https://api.github.com/repos/Anthon123/Hangfire/commits{/sha}","git_commits_url":"https://api.github.com/repos/Anthon123/Hangfire/git/commits{/sha}","comments_url":"https://api.github.com/repos/Anthon123/Hangfire/comments{/number}","issue_comment_url":"https://api.github.com/repos/Anthon123/Hangfire/issues/comments{/number}","contents_url":"https://api.github.com/repos/Anthon123/Hangfire/contents/{+path}","compare_url":"https://api.github.com/repos/Anthon123/Hangfire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Anthon123/Hangfire/merges","archive_url":"https://api.github.com/repos/Anthon123/Hangfire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Anthon123/Hangfire/downloads","issues_url":"https://api.github.com/repos/Anthon123/Hangfire/issues{/number}","pulls_url":"https://api.github.com/repos/Anthon123/Hangfire/pulls{/number}","milestones_url":"https://api.github.com/repos/Anthon123/Hangfire/milestones{/number}","notifications_url":"https://api.github.com/repos/Anthon123/Hangfire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Anthon123/Hangfire/labels{/name}","releases_url":"https://api.github.com/repos/Anthon123/Hangfire/releases{/id}","deployments_url":"https://api.github.com/repos/Anthon123/Hangfire/deployments","created_at":"2016-06-01T13:25:24Z","updated_at":"2016-06-01T13:25:26Z","pushed_at":"2016-07-14T12:23:35Z","git_url":"git://github.com/Anthon123/Hangfire.git","ssh_url":"git@github.com:Anthon123/Hangfire.git","clone_url":"https://github.com/Anthon123/Hangfire.git","svn_url":"https://github.com/Anthon123/Hangfire","homepage":"http://hangfire.io","size":25253,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"eTechSolutions:NotificationModule","ref":"NotificationModule","sha":"3895ecf3718e394d5908089221bd79aa35e21c6e","user":{"login":"eTechSolutions","id":1301266,"avatar_url":"https://avatars.githubusercontent.com/u/1301266?v=3","gravatar_id":"","url":"https://api.github.com/users/eTechSolutions","html_url":"https://github.com/eTechSolutions","followers_url":"https://api.github.com/users/eTechSolutions/followers","following_url":"https://api.github.com/users/eTechSolutions/following{/other_user}","gists_url":"https://api.github.com/users/eTechSolutions/gists{/gist_id}","starred_url":"https://api.github.com/users/eTechSolutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eTechSolutions/subscriptions","organizations_url":"https://api.github.com/users/eTechSolutions/orgs","repos_url":"https://api.github.com/users/eTechSolutions/repos","events_url":"https://api.github.com/users/eTechSolutions/events{/privacy}","received_events_url":"https://api.github.com/users/eTechSolutions/received_events","type":"Organization","site_admin":false},"repo":{"id":58209027,"name":"Hangfire","full_name":"eTechSolutions/Hangfire","owner":{"login":"eTechSolutions","id":1301266,"avatar_url":"https://avatars.githubusercontent.com/u/1301266?v=3","gravatar_id":"","url":"https://api.github.com/users/eTechSolutions","html_url":"https://github.com/eTechSolutions","followers_url":"https://api.github.com/users/eTechSolutions/followers","following_url":"https://api.github.com/users/eTechSolutions/following{/other_user}","gists_url":"https://api.github.com/users/eTechSolutions/gists{/gist_id}","starred_url":"https://api.github.com/users/eTechSolutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eTechSolutions/subscriptions","organizations_url":"https://api.github.com/users/eTechSolutions/orgs","repos_url":"https://api.github.com/users/eTechSolutions/repos","events_url":"https://api.github.com/users/eTechSolutions/events{/privacy}","received_events_url":"https://api.github.com/users/eTechSolutions/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/eTechSolutions/Hangfire","description":"An easy way to perform fire-and-forget, delayed and recurring tasks inside ASP.NET apps","fork":true,"url":"https://api.github.com/repos/eTechSolutions/Hangfire","forks_url":"https://api.github.com/repos/eTechSolutions/Hangfire/forks","keys_url":"https://api.github.com/repos/eTechSolutions/Hangfire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eTechSolutions/Hangfire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eTechSolutions/Hangfire/teams","hooks_url":"https://api.github.com/repos/eTechSolutions/Hangfire/hooks","issue_events_url":"https://api.github.com/repos/eTechSolutions/Hangfire/issues/events{/number}","events_url":"https://api.github.com/repos/eTechSolutions/Hangfire/events","assignees_url":"https://api.github.com/repos/eTechSolutions/Hangfire/assignees{/user}","branches_url":"https://api.github.com/repos/eTechSolutions/Hangfire/branches{/branch}","tags_url":"https://api.github.com/repos/eTechSolutions/Hangfire/tags","blobs_url":"https://api.github.com/repos/eTechSolutions/Hangfire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eTechSolutions/Hangfire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eTechSolutions/Hangfire/git/refs{/sha}","trees_url":"https://api.github.com/repos/eTechSolutions/Hangfire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eTechSolutions/Hangfire/statuses/{sha}","languages_url":"https://api.github.com/repos/eTechSolutions/Hangfire/languages","stargazers_url":"https://api.github.com/repos/eTechSolutions/Hangfire/stargazers","contributors_url":"https://api.github.com/repos/eTechSolutions/Hangfire/contributors","subscribers_url":"https://api.github.com/repos/eTechSolutions/Hangfire/subscribers","subscription_url":"https://api.github.com/repos/eTechSolutions/Hangfire/subscription","commits_url":"https://api.github.com/repos/eTechSolutions/Hangfire/commits{/sha}","git_commits_url":"https://api.github.com/repos/eTechSolutions/Hangfire/git/commits{/sha}","comments_url":"https://api.github.com/repos/eTechSolutions/Hangfire/comments{/number}","issue_comment_url":"https://api.github.com/repos/eTechSolutions/Hangfire/issues/comments{/number}","contents_url":"https://api.github.com/repos/eTechSolutions/Hangfire/contents/{+path}","compare_url":"https://api.github.com/repos/eTechSolutions/Hangfire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eTechSolutions/Hangfire/merges","archive_url":"https://api.github.com/repos/eTechSolutions/Hangfire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eTechSolutions/Hangfire/downloads","issues_url":"https://api.github.com/repos/eTechSolutions/Hangfire/issues{/number}","pulls_url":"https://api.github.com/repos/eTechSolutions/Hangfire/pulls{/number}","milestones_url":"https://api.github.com/repos/eTechSolutions/Hangfire/milestones{/number}","notifications_url":"https://api.github.com/repos/eTechSolutions/Hangfire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eTechSolutions/Hangfire/labels{/name}","releases_url":"https://api.github.com/repos/eTechSolutions/Hangfire/releases{/id}","deployments_url":"https://api.github.com/repos/eTechSolutions/Hangfire/deployments","created_at":"2016-05-06T13:25:29Z","updated_at":"2016-07-14T08:50:28Z","pushed_at":"2016-07-14T12:23:36Z","git_url":"git://github.com/eTechSolutions/Hangfire.git","ssh_url":"git@github.com:eTechSolutions/Hangfire.git","clone_url":"https://github.com/eTechSolutions/Hangfire.git","svn_url":"https://github.com/eTechSolutions/Hangfire","homepage":"http://hangfire.io","size":25301,"stargazers_count":1,"watchers_count":1,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":8,"forks":1,"open_issues":8,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/eTechSolutions/Hangfire/pulls/15"},"html":{"href":"https://github.com/eTechSolutions/Hangfire/pull/15"},"issue":{"href":"https://api.github.com/repos/eTechSolutions/Hangfire/issues/15"},"comments":{"href":"https://api.github.com/repos/eTechSolutions/Hangfire/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/eTechSolutions/Hangfire/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/eTechSolutions/Hangfire/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eTechSolutions/Hangfire/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/eTechSolutions/Hangfire/statuses/3a715b26665042ed7582175c427d19587ebf4a54"}}}}
{"actor":{"display_login":"mahoneyj2"}}