Time Travel

Sometimes I can just kick my own backside. I believe a feeling all developers have felt at some stage (like forgetting a semicolon).

So I have a cron job on Google AppEngine that stops and starts a server for a client every day ( don’t ask why ). For the last week that this cron job have been running it stops the server but every morning the server will not be started.

So I tested my code and it will run perfectly every time. So this morning after the server did not startup AGAIN, I had a second look at the cron jobs and thats when it happened. I forgot to set the time zone for the cron jobs. It was running on GMT time and not our local time zone. That set my cron jobs out with two hours. So the server would startup but not at the time I wanted it to start.

So when setting up a cron job in AppEngine please remember to set the timezone so that you do not have to sit with the same issue I have. It is as easy as adding the following line in your schedule:

timezone: Australia/NSW

Your timezone can be found at the following wikipedia page:

https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

So do not let your code time travel.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s