{"action":"created","issue":{"url":"https://api.github.com/repos/OrchardCMS/OrchardCore/issues/2528","repository_url":"https://api.github.com/repos/OrchardCMS/OrchardCore","labels_url":"https://api.github.com/repos/OrchardCMS/OrchardCore/issues/2528/labels{/name}","comments_url":"https://api.github.com/repos/OrchardCMS/OrchardCore/issues/2528/comments","events_url":"https://api.github.com/repos/OrchardCMS/OrchardCore/issues/2528/events","html_url":"https://github.com/OrchardCMS/OrchardCore/issues/2528","id":371545452,"node_id":"MDU6SXNzdWUzNzE1NDU0NTI=","number":2528,"title":"BackgroundTaskService.SetDelay should be able to restart timer optionally","user":{"login":"barthamark","id":8542607,"node_id":"MDQ6VXNlcjg1NDI2MDc=","avatar_url":"https://avatars1.githubusercontent.com/u/8542607?v=4","gravatar_id":"","url":"https://api.github.com/users/barthamark","html_url":"https://github.com/barthamark","followers_url":"https://api.github.com/users/barthamark/followers","following_url":"https://api.github.com/users/barthamark/following{/other_user}","gists_url":"https://api.github.com/users/barthamark/gists{/gist_id}","starred_url":"https://api.github.com/users/barthamark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barthamark/subscriptions","organizations_url":"https://api.github.com/users/barthamark/orgs","repos_url":"https://api.github.com/users/barthamark/repos","events_url":"https://api.github.com/users/barthamark/events{/privacy}","received_events_url":"https://api.github.com/users/barthamark/received_events","type":"User","site_admin":false},"labels":[{"id":149551464,"node_id":"MDU6TGFiZWwxNDk1NTE0NjQ=","url":"https://api.github.com/repos/OrchardCMS/OrchardCore/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-10-18T14:00:26Z","updated_at":"2018-11-06T21:45:50Z","closed_at":"2018-11-06T21:45:50Z","author_association":"NONE","body":"I am trying to create a background task that runs in every second instead of the default 1 minute interval. I see that there is a SetDelay method on the IBackgroundTaskService which looks like a good way to achieve this. I've called it in the Startup.Configure() method of my module, however, it made my background task stop immediately. When I called the BackgroundTaskService.Activate() it restarted and works fine, however, it reactivates all the background tasks. I am not perfectly sure if it will be an issue if there are multiple background tasks but it will definitely restart all the timers.\r\n\r\nMaybe there's another way to achieve this, if yes, please point me to the right direction. However, I think one simple solution would be to add an (optional) parameter to the SetDelay method which prevents the Timer to stop and will just keep working with the new period."},"comment":{"url":"https://api.github.com/repos/OrchardCMS/OrchardCore/issues/comments/436419922","html_url":"https://github.com/OrchardCMS/OrchardCore/issues/2528#issuecomment-436419922","issue_url":"https://api.github.com/repos/OrchardCMS/OrchardCore/issues/2528","id":436419922,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNjQxOTkyMg==","user":{"login":"barthamark","id":8542607,"node_id":"MDQ6VXNlcjg1NDI2MDc=","avatar_url":"https://avatars1.githubusercontent.com/u/8542607?v=4","gravatar_id":"","url":"https://api.github.com/users/barthamark","html_url":"https://github.com/barthamark","followers_url":"https://api.github.com/users/barthamark/followers","following_url":"https://api.github.com/users/barthamark/following{/other_user}","gists_url":"https://api.github.com/users/barthamark/gists{/gist_id}","starred_url":"https://api.github.com/users/barthamark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barthamark/subscriptions","organizations_url":"https://api.github.com/users/barthamark/orgs","repos_url":"https://api.github.com/users/barthamark/repos","events_url":"https://api.github.com/users/barthamark/events{/privacy}","received_events_url":"https://api.github.com/users/barthamark/received_events","type":"User","site_admin":false},"created_at":"2018-11-06T21:45:50Z","updated_at":"2018-11-06T21:45:50Z","author_association":"NONE","body":"I think this has been answered thank you both for the help."}}
{"actor":{"display_login":"barthamark"}}