{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-extensions/issues/40","repository_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-extensions","labels_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-extensions/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-extensions/issues/40/comments","events_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-extensions/issues/40/events","html_url":"https://github.com/Azure/azure-webjobs-sdk-extensions/issues/40","id":134863848,"number":40,"title":"Repeated executions","user":{"login":"paolorr","id":4966400,"avatar_url":"https://avatars.githubusercontent.com/u/4966400?v=3","gravatar_id":"","url":"https://api.github.com/users/paolorr","html_url":"https://github.com/paolorr","followers_url":"https://api.github.com/users/paolorr/followers","following_url":"https://api.github.com/users/paolorr/following{/other_user}","gists_url":"https://api.github.com/users/paolorr/gists{/gist_id}","starred_url":"https://api.github.com/users/paolorr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paolorr/subscriptions","organizations_url":"https://api.github.com/users/paolorr/orgs","repos_url":"https://api.github.com/users/paolorr/repos","events_url":"https://api.github.com/users/paolorr/events{/privacy}","received_events_url":"https://api.github.com/users/paolorr/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-extensions/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"mathewc","id":1056548,"avatar_url":"https://avatars.githubusercontent.com/u/1056548?v=3","gravatar_id":"","url":"https://api.github.com/users/mathewc","html_url":"https://github.com/mathewc","followers_url":"https://api.github.com/users/mathewc/followers","following_url":"https://api.github.com/users/mathewc/following{/other_user}","gists_url":"https://api.github.com/users/mathewc/gists{/gist_id}","starred_url":"https://api.github.com/users/mathewc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathewc/subscriptions","organizations_url":"https://api.github.com/users/mathewc/orgs","repos_url":"https://api.github.com/users/mathewc/repos","events_url":"https://api.github.com/users/mathewc/events{/privacy}","received_events_url":"https://api.github.com/users/mathewc/received_events","type":"User","site_admin":false},"assignees":[{"login":"mathewc","id":1056548,"avatar_url":"https://avatars.githubusercontent.com/u/1056548?v=3","gravatar_id":"","url":"https://api.github.com/users/mathewc","html_url":"https://github.com/mathewc","followers_url":"https://api.github.com/users/mathewc/followers","following_url":"https://api.github.com/users/mathewc/following{/other_user}","gists_url":"https://api.github.com/users/mathewc/gists{/gist_id}","starred_url":"https://api.github.com/users/mathewc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathewc/subscriptions","organizations_url":"https://api.github.com/users/mathewc/orgs","repos_url":"https://api.github.com/users/mathewc/repos","events_url":"https://api.github.com/users/mathewc/events{/privacy}","received_events_url":"https://api.github.com/users/mathewc/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-extensions/milestones/4","html_url":"https://github.com/Azure/azure-webjobs-sdk-extensions/milestones/2.0.0-preview","labels_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-extensions/milestones/4/labels","id":1526783,"number":4,"title":"2.0.0-preview","description":"","creator":{"login":"rustd","id":1132652,"avatar_url":"https://avatars.githubusercontent.com/u/1132652?v=3","gravatar_id":"","url":"https://api.github.com/users/rustd","html_url":"https://github.com/rustd","followers_url":"https://api.github.com/users/rustd/followers","following_url":"https://api.github.com/users/rustd/following{/other_user}","gists_url":"https://api.github.com/users/rustd/gists{/gist_id}","starred_url":"https://api.github.com/users/rustd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rustd/subscriptions","organizations_url":"https://api.github.com/users/rustd/orgs","repos_url":"https://api.github.com/users/rustd/repos","events_url":"https://api.github.com/users/rustd/events{/privacy}","received_events_url":"https://api.github.com/users/rustd/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":15,"state":"open","created_at":"2016-01-20T18:46:58Z","updated_at":"2016-07-20T20:23:27Z","due_on":"2017-03-10T08:00:00Z","closed_at":null},"comments":14,"created_at":"2016-02-19T13:24:14Z","updated_at":"2016-07-28T13:38:19Z","closed_at":null,"body":"I'm using TimerTrigger to run a job daily at 18:00 (6pm UTC -2:00) but I noticed the job sometimes runs twice as shown in the log\r\n\r\nIn this case it runs twice due to website restart, which I don't know why, because it's set Always On\r\n```\r\n[02/15/2016 19:59:59 > f70569: INFO] Executing: 'Functions.SendPublishedInspections' - Reason: 'Timer fired at 2016-02-15T17:59:58.6655227-02:00'\r\n[02/15/2016 20:00:00 > f70569: INFO] Executed: 'Functions.SendPublishedInspections' (Succeeded)\r\n[02/15/2016 20:42:53 > 9dad03: SYS INFO] Status changed to Starting\r\n...\r\n[02/15/2016 20:43:08 > 9dad03: INFO] Job host started\r\n[02/15/2016 20:45:45 > f70569: SYS INFO] WebJob is stopping due to website shutting down\r\n[02/15/2016 20:45:45 > f70569: SYS INFO] Status changed to Stopping\r\n[02/15/2016 20:45:46 > f70569: INFO] Job host stopped\r\n[02/15/2016 20:45:47 > f70569: SYS INFO] Status changed to Success\r\n[02/15/2016 20:45:47 > f70569: SYS INFO] Status changed to Stopped\r\n[02/15/2016 20:46:09 > 9dad03: INFO] Executing: 'Functions.SendPublishedInspections' - Reason: 'Timer fired at 2016-02-15T18:46:09.0790525-02:00'\r\n[02/15/2016 20:46:10 > 9dad03: INFO] Executed: 'Functions.SendPublishedInspections' (Succeeded)\r\n```\r\n\r\nIn this case it runs twice due to webjob restart, which I also don't know why, because the website hasn't restarted. Notice that the first execution was ok, at 17:59, but the second execution was at 22:45, 4 hours after the scheduled time\r\n```\r\n[02/18/2016 19:59:59 > 2627e8: INFO] Executing: 'Functions.SendPublishedInspections' - Reason: 'Timer fired at 2016-02-18T17:59:59.7431098-02:00'\r\n[02/18/2016 20:00:00 > 2627e8: INFO] Executed: 'Functions.SendPublishedInspections' (Succeeded)\r\n[02/19/2016 00:44:44 > 2627e8: SYS INFO] Status changed to Starting\r\n..\r\n[02/19/2016 00:44:51 > 2627e8: INFO] Job host started\r\n[02/19/2016 00:45:52 > 2627e8: INFO] Executing: 'Functions.SendPublishedInspections' - Reason: 'Timer fired at 2016-02-18T22:45:51.8263891-02:00'\r\n[02/19/2016 00:45:53 > 2627e8: INFO] Executed: 'Functions.SendPublishedInspections' (Succeeded)\r\n```\r\n\r\nIn this case it simply runs twice in a row\r\n```\r\n[02/16/2016 19:59:56 > 9dad03: INFO] Executing: 'Functions.SendPublishedInspections' - Reason: 'Timer fired at 2016-02-16T17:59:56.5463054-02:00'\r\n[02/16/2016 19:59:57 > 9dad03: INFO] Executed: 'Functions.SendPublishedInspections' (Succeeded)\r\n[02/16/2016 20:00:00 > 9dad03: INFO] Executing: 'Functions.SendPublishedInspections' - Reason: 'Timer fired at 2016-02-16T18:00:00.0280857-02:00'\r\n[02/16/2016 20:00:00 > 9dad03: INFO] Executed: 'Functions.SendPublishedInspections' (Succeeded)\r\n```\r\n\r\nHere is my scheduled config\r\n\r\n```\r\n    public class PublishedInspectionsSchedule : WeeklySchedule\r\n    {\r\n        public PublishedInspectionsSchedule() :\r\n            base()\r\n        {\r\n            var configHours = ConfigurationManager.AppSettings[\"PublishedInspectionsSchedule\"];\r\n\r\n            if (!string.IsNullOrWhiteSpace(configHours))\r\n            {\r\n                var times = configHours.Split(',').Select(x => TimeSpan.Parse(x)).OrderBy(p => p).ToList();\r\n                foreach (var item in times)\r\n                {\r\n                    Add(DayOfWeek.Monday, item);\r\n                    Add(DayOfWeek.Tuesday, item);\r\n                    Add(DayOfWeek.Wednesday, item);\r\n                    Add(DayOfWeek.Thursday, item);\r\n                    Add(DayOfWeek.Friday, item);\r\n                    Add(DayOfWeek.Saturday, item);\r\n                    Add(DayOfWeek.Sunday, item);\r\n                }\r\n            }\r\n        }\r\n    }\r\n```\r\n\r\n\r\nIs there some kind of configuration that I can set a interval of execution, e.g., 1 minute before and 1 minute after the scheduled time? If the job restarts, the second time would be out of the interval and won't run.\r\n\r\nAny ideia why the job is restarting?\r\n\r\nAny ideia why it ran twice in a row?"},"comment":{"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-extensions/issues/comments/235896714","html_url":"https://github.com/Azure/azure-webjobs-sdk-extensions/issues/40#issuecomment-235896714","issue_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-extensions/issues/40","id":235896714,"user":{"login":"Thnslj","id":20703505,"avatar_url":"https://avatars.githubusercontent.com/u/20703505?v=3","gravatar_id":"","url":"https://api.github.com/users/Thnslj","html_url":"https://github.com/Thnslj","followers_url":"https://api.github.com/users/Thnslj/followers","following_url":"https://api.github.com/users/Thnslj/following{/other_user}","gists_url":"https://api.github.com/users/Thnslj/gists{/gist_id}","starred_url":"https://api.github.com/users/Thnslj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thnslj/subscriptions","organizations_url":"https://api.github.com/users/Thnslj/orgs","repos_url":"https://api.github.com/users/Thnslj/repos","events_url":"https://api.github.com/users/Thnslj/events{/privacy}","received_events_url":"https://api.github.com/users/Thnslj/received_events","type":"User","site_admin":false},"created_at":"2016-07-28T13:38:19Z","updated_at":"2016-07-28T13:38:19Z","body":"@mattwoberts I think I have found an explanation to issue #2 \r\nhttps://github.com/Azure/azure-webjobs-sdk-extensions/issues/132\r\n"}}
{"actor":{"display_login":"Thnslj"}}