I see the news in the sidebar is updating
The funny thing about that is that it could have been working all along
When admin (of blessed memory) and I set it up some years ago, I had it working by fetching the CUK main site's RSS feed and updating with any new stories. But when we deployed it to the server, it didn't work. It turned out that admin had various firewall rules set up to protect the server and one of them was blocking it from fetching the feed over the web.
It was late and we'd already been working on forum deployment stuff for hours, so we went for a quick and easy fix: he set up a cron job, which was exempt from the relevant firewall rule, which fetched the feed and saved it to the server. Then my scheduled task could read that file and update the news that way.
When admin moved on, the new administrators moved things over to their container-based systems. But they missed the cron job, because I suppose they never thought to look and admin had probably forgotten all about it. So the news remained stuck because the file was never updated.
Anyway, yesterday when I'd sorted out the memcache stuff, I went and had a look at the code for updating the news; I was wondering if I could work out how to get it working. I'd also forgotten all of the above. But what did I see: the line that fetched the RSS feed directly, commented out, above the three or so lines that got it from the file
So I commented out the stuff for reading the file, and uncommented the original line that fetches the feed directly, and it works!
We should probably have documented this stuff but as I say, it was late
The funny thing about that is that it could have been working all along
When admin (of blessed memory) and I set it up some years ago, I had it working by fetching the CUK main site's RSS feed and updating with any new stories. But when we deployed it to the server, it didn't work. It turned out that admin had various firewall rules set up to protect the server and one of them was blocking it from fetching the feed over the web.
It was late and we'd already been working on forum deployment stuff for hours, so we went for a quick and easy fix: he set up a cron job, which was exempt from the relevant firewall rule, which fetched the feed and saved it to the server. Then my scheduled task could read that file and update the news that way.
When admin moved on, the new administrators moved things over to their container-based systems. But they missed the cron job, because I suppose they never thought to look and admin had probably forgotten all about it. So the news remained stuck because the file was never updated.
Anyway, yesterday when I'd sorted out the memcache stuff, I went and had a look at the code for updating the news; I was wondering if I could work out how to get it working. I'd also forgotten all of the above. But what did I see: the line that fetched the RSS feed directly, commented out, above the three or so lines that got it from the file
So I commented out the stuff for reading the file, and uncommented the original line that fetches the feed directly, and it works!
We should probably have documented this stuff but as I say, it was late
Comment