{"action":"created","issue":{"url":"https://api.github.com/repos/wreckage/django-happenings/issues/9","labels_url":"https://api.github.com/repos/wreckage/django-happenings/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/wreckage/django-happenings/issues/9/comments","events_url":"https://api.github.com/repos/wreckage/django-happenings/issues/9/events","html_url":"https://github.com/wreckage/django-happenings/issues/9","id":99927077,"number":9,"title":"upcoming_events and current_happenings don't update for Repeated events without restart.","user":{"login":"tommybobbins","id":5563822,"avatar_url":"https://avatars.githubusercontent.com/u/5563822?v=3","gravatar_id":"","url":"https://api.github.com/users/tommybobbins","html_url":"https://github.com/tommybobbins","followers_url":"https://api.github.com/users/tommybobbins/followers","following_url":"https://api.github.com/users/tommybobbins/following{/other_user}","gists_url":"https://api.github.com/users/tommybobbins/gists{/gist_id}","starred_url":"https://api.github.com/users/tommybobbins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tommybobbins/subscriptions","organizations_url":"https://api.github.com/users/tommybobbins/orgs","repos_url":"https://api.github.com/users/tommybobbins/repos","events_url":"https://api.github.com/users/tommybobbins/events{/privacy}","received_events_url":"https://api.github.com/users/tommybobbins/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-09T20:41:01Z","updated_at":"2015-08-13T05:13:40Z","closed_at":null,"body":"I've found a bug with current_happenings and upcoming_events. The result appears to be cached from when Apache was first started/restarted. Here are my repeating events:\r\n```\r\nsqlite> select * from happenings_event;\r\n1|2015-06-24 06:00:00|2015-06-24 08:59:59|0|WEEKDAY||Temp=19.2|Temp=19.2|eeeeee||000000||1\r\n2|2015-06-24 21:30:01|2015-06-24 22:59:59|0|WEEKDAY||Temp=7.2|Temp=7.2|eeeeee||000000||1\r\n4|2015-06-24 09:00:00|2015-06-24 15:00:00|0|WEEKDAY||Temp=8.1|Temp=8.1|eeeeee||000000||1\r\n5|2015-06-24 15:00:01|2015-06-24 21:30:00|0|WEEKDAY||Temp=19|Temp=19|eeeeee||000000||1\r\n6|2015-06-23 23:00:01|2015-06-24 05:59:59|0|WEEKDAY||Temp=8.1|Temp=8.1|eeeeee||000000||1\r\n7|2015-06-26 23:00:01|2015-06-27 05:00:00|0|WEEKLY||Temp=7|Temp=7|eeeeee||000000||1\r\n8|2015-06-27 05:00:01|2015-06-27 09:00:00|0|WEEKLY||Temp=19|Temp=19|eeeeee||000000||1\r\n9|2015-06-27 09:00:01|2015-06-27 15:00:00|0|WEEKLY||Temp=15|Temp=15|eeeeee||000000||1\r\n10|2015-06-27 15:00:01|2015-06-27 22:00:00|0|WEEKLY||Temp=19|Temp=19|eeeeee||000000||1\r\n11|2015-06-27 22:00:01|2015-06-27 22:59:59|0|WEEKLY||Temp=7|Temp=7|eeeeee||000000||1\r\n12|2015-06-27 23:00:01|2015-06-28 05:00:00|0|WEEKLY||Temp=7|Temp=7|eeeeee||000000||1\r\n13|2015-06-28 05:00:01|2015-06-28 09:00:00|0|WEEKLY||Temp=19|Temp=19|eeeeee||000000||1\r\n14|2015-06-28 09:00:01|2015-06-28 15:00:00|0|WEEKLY||Temp=15|Temp=15|eeeeee||000000||1\r\n15|2015-06-28 15:00:01|2015-06-28 22:00:00|0|WEEKLY||Temp=19|Temp=19|eeeeee||000000||1\r\n16|2015-06-28 22:00:01|2015-06-28 22:59:59|0|WEEKLY||Temp=7|Temp=7|eeeeee||000000||1\r\n```\r\nI'm using this in URLs:\r\n```\r\n    (r'^current/$', current ),\r\n    (r'^upcoming/$', upcoming ),\r\n```\r\nand this in views.py\r\n```\r\ndef upcoming(request):\r\n    return render(request,'lights/upcoming_events.html')\r\ndef current(request):\r\n    return render(request,'lights/current_happenings.html')\r\n```\r\n```\r\n$ more current_happenings.html \r\n{% extends \"base.html\" %}\r\n{% block content %}\r\n<div class=\"lcars_command\">\r\n    <h2>CURRENT</h2>\r\n{% load happenings_tags %}\r\n{% current_happenings %}\r\n</div>\r\n{% endblock %}\r\n```\r\n\r\n```\r\n$ more upcoming_events.html\r\n{% extends \"base.html\" %}\r\n{% block content %}\r\n<div class=\"lcars_command\">\r\n   <h2>CURRENT</h2>\r\n{% load happenings_tags %}\r\n{% upcoming_events num=1%}\r\n</div>\r\n{% endblock %}\r\n```\r\n\r\nEvery hour we are running this via cron:\r\n\r\nmore /usr/local/bin/check_temp.sh \r\n    #!/bin/bash\r\n    date >>/var/tmp/temp_checker.txt\r\n    date >>/var/tmp/current_checker.txt\r\n    curl http://localhost/tempcal/ | grep \"Temp=\" >>/var/tmp/temp_checker.txt \r\n    curl http://localhost/current/ | grep \"Temp=\" >>/var/tmp/current_checker.txt\r\n\r\n\r\nAs can be seen, the reported current_happenings never changes\r\n```\r\n$ head current_checker.txt \r\nSun Aug  2 07:00:01 BST 2015\r\n                        Temp=19\r\nSun Aug  2 08:00:01 BST 2015\r\n                        Temp=19\r\nSun Aug  2 09:00:01 BST 2015\r\n                        Temp=19\r\nSun Aug  2 10:00:01 BST 2015\r\n                        Temp=19\r\nSun Aug  2 11:00:01 BST 2015\r\n                        Temp=19\r\n$ tail current_checker.txt \r\nSun Aug  9 17:00:01 BST 2015\r\n                        Temp=19\r\nSun Aug  9 18:00:01 BST 2015\r\n                        Temp=19\r\nSun Aug  9 19:00:01 BST 2015\r\n                        Temp=19\r\nSun Aug  9 20:00:01 BST 2015\r\n                        Temp=19\r\nSun Aug  9 21:00:01 BST 2015\r\n                        Temp=19\r\n```\r\n\r\nSimilarly the upcoming_events never changes: \r\n```\r\n$ head temp_checker.txt \r\nSun Aug  2 11:00:01 BST 2015\r\n                        Temp=15\r\nSun Aug  2 12:00:01 BST 2015\r\n                        Temp=15\r\nSun Aug  2 13:00:01 BST 2015\r\n                        Temp=15\r\nSun Aug  2 14:00:01 BST 2015\r\n                        Temp=15\r\nSun Aug  2 15:00:01 BST 2015\r\n                        Temp=15\r\n$ tail temp_checker.txt \r\nSun Aug  9 17:00:01 BST 2015\r\n                        Temp=15\r\nSun Aug  9 18:00:01 BST 2015\r\n                        Temp=15\r\nSun Aug  9 19:00:01 BST 2015\r\n                        Temp=15\r\nSun Aug  9 20:00:01 BST 2015\r\n                        Temp=15\r\nSun Aug  9 21:00:01 BST 2015\r\n                        Temp=15\r\n```\r\nIf I restart Apache, then they do update (current_happenings should actually return Temp=19):\r\n```\r\ntail -2 /var/tmp/current_checker.txt \r\nSun Aug  9 21:14:59 BST 2015\r\n                        Temp=19\r\n\r\ntail -2 /var/tmp/temp_checker.txt \r\nSun Aug  9 21:14:59 BST 2015\r\n                        Temp=7\r\n```\r\nEach time I restart Apache, I get the right result."},"comment":{"url":"https://api.github.com/repos/wreckage/django-happenings/issues/comments/130537684","html_url":"https://github.com/wreckage/django-happenings/issues/9#issuecomment-130537684","issue_url":"https://api.github.com/repos/wreckage/django-happenings/issues/9","id":130537684,"user":{"login":"wreckage","id":5462671,"avatar_url":"https://avatars.githubusercontent.com/u/5462671?v=3","gravatar_id":"","url":"https://api.github.com/users/wreckage","html_url":"https://github.com/wreckage","followers_url":"https://api.github.com/users/wreckage/followers","following_url":"https://api.github.com/users/wreckage/following{/other_user}","gists_url":"https://api.github.com/users/wreckage/gists{/gist_id}","starred_url":"https://api.github.com/users/wreckage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wreckage/subscriptions","organizations_url":"https://api.github.com/users/wreckage/orgs","repos_url":"https://api.github.com/users/wreckage/repos","events_url":"https://api.github.com/users/wreckage/events{/privacy}","received_events_url":"https://api.github.com/users/wreckage/received_events","type":"User","site_admin":false},"created_at":"2015-08-13T05:13:40Z","updated_at":"2015-08-13T05:13:40Z","body":"The same thing is happening to me on my local server. What's odd is that even when I use django's DummyCache (https://docs.djangoproject.com/en/1.7/topics/cache/#dummy-caching-for-development), which doesn't cache at all, it still won't update. Maybe javascript is necessary here? I'll continue to look into it, but if you're able to pinpoint the problem and create a solution, please submit a pull request."}}