July 19, 2004
Your First Assumption Should Be "It's My Fault"
When writing code, it's always a good idea to remember that when things aren't behaving as you expect then the chances are you've done something wrong. Unfortunately, it's always tempting to try to explain it away as a bug in someone else's code, or that there's some other reason that lets you off the hook.
I try not to fall into that trap, but in my rush to get NewMusicRadio finished over the weekend I succumbed. I let myself think that the reason the cron job was taking most of the day to check a few websites was either NTL being flakey as usual, or that some of the MP3 blogs had some form of advanced wget detection script running which left connections hanging for ages.
Stupid Adrian. A brief look into it this morning shows there's some problem with using the --ignore-length
option of wget that results in neither wget nor the web server realising that the transfer has finished in some cases.
So, until I get some time to either work out how to stop the connections hanging, or code an alternative approach to deleting tracks, I've removed the --ignore-length
options from the example cron script so the delete functionality won't work.
This blog post is on the personal blog of Adrian McEwen. If you want to explore the site a bit further, it might be worth having a look at the most recent entries or look through the archives or categories over on the left.
If you want to hire my company to help you with the Internet of Things then get in touch. If you want to learn more about the Internet of Things, then buy my book Designing the Internet of Things (amazon.co.uk amazon.com).