{"action":"created","issue":{"url":"https://api.github.com/repos/HabitRPG/habitrpg/issues/4488","labels_url":"https://api.github.com/repos/HabitRPG/habitrpg/issues/4488/labels{/name}","comments_url":"https://api.github.com/repos/HabitRPG/habitrpg/issues/4488/comments","events_url":"https://api.github.com/repos/HabitRPG/habitrpg/issues/4488/events","html_url":"https://github.com/HabitRPG/habitrpg/issues/4488","id":53647401,"number":4488,"title":"Cron run early when changing CDS to an hour past that of the last cron","user":{"login":"paglias","id":589911,"avatar_url":"https://avatars.githubusercontent.com/u/589911?v=3","gravatar_id":"","url":"https://api.github.com/users/paglias","html_url":"https://github.com/paglias","followers_url":"https://api.github.com/users/paglias/followers","following_url":"https://api.github.com/users/paglias/following{/other_user}","gists_url":"https://api.github.com/users/paglias/gists{/gist_id}","starred_url":"https://api.github.com/users/paglias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paglias/subscriptions","organizations_url":"https://api.github.com/users/paglias/orgs","repos_url":"https://api.github.com/users/paglias/repos","events_url":"https://api.github.com/users/paglias/events{/privacy}","received_events_url":"https://api.github.com/users/paglias/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-01-07T16:00:14Z","updated_at":"2015-07-04T04:21:38Z","closed_at":null,"body":"To reproduce:\r\n\r\n1. User has `dayStart` set to `0` and logins at `1am` of `Jan 1`\r\n2. On `Jan 1` at `2am` user changes `dayStart` to `4am`\r\n3. When the user perform an action on `Jan 1` past `4am` the system will see a `lastCron` that happened before `4am`, it will think of it as yesterday and run cron.\r\n\r\n**Possible solution:**\r\n\r\nStore the old `dayStart` value and use it to calculate if cron should run here https://github.com/HabitRPG/habitrpg-shared/blob/develop/script/index.coffee#L72\r\n\r\n \r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/7563463-cron-run-early-when-changing-cds-to-an-hour-past-that-of-the-last-cron?utm_campaign=plugin&utm_content=tracker%2F68393&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F68393&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/HabitRPG/habitrpg/issues/comments/118460836","html_url":"https://github.com/HabitRPG/habitrpg/issues/4488#issuecomment-118460836","issue_url":"https://api.github.com/repos/HabitRPG/habitrpg/issues/4488","id":118460836,"user":{"login":"carolstone","id":9287541,"avatar_url":"https://avatars.githubusercontent.com/u/9287541?v=3","gravatar_id":"","url":"https://api.github.com/users/carolstone","html_url":"https://github.com/carolstone","followers_url":"https://api.github.com/users/carolstone/followers","following_url":"https://api.github.com/users/carolstone/following{/other_user}","gists_url":"https://api.github.com/users/carolstone/gists{/gist_id}","starred_url":"https://api.github.com/users/carolstone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carolstone/subscriptions","organizations_url":"https://api.github.com/users/carolstone/orgs","repos_url":"https://api.github.com/users/carolstone/repos","events_url":"https://api.github.com/users/carolstone/events{/privacy}","received_events_url":"https://api.github.com/users/carolstone/received_events","type":"User","site_admin":false},"created_at":"2015-07-04T04:21:38Z","updated_at":"2015-07-04T04:21:38Z","body":"@crookedneighbor  That makes a lot more sense than anything I was looking at. Thank you. I'll pick up there tomorrow (well, later today). "}}