Not exactly a question more a gotcha. So I was using skybrud social and getting twitter stats the last time i used the app was around February and all was working fine.
I was processing around 500 accounts and was batching them using the X-Rate-Limit-Reset returned from twitter via Reset data send from skybrud api. So when i got close to limit i would thread sleep for 13mins.
I recently ran the app again but this time my reset date - datetime.now was always a negative value. I found that the date coming back from twitter was not taking into account UK daylight saving time. Its April and in the UK we are not in summer time, so i have had to add 1 hr to the reset date and now all is working again. There are 2 problems in software working with dates and invalidating cache :-}
Twitter X-Rate-Limit-Reset
Not exactly a question more a gotcha. So I was using skybrud social and getting twitter stats the last time i used the app was around February and all was working fine.
I was processing around 500 accounts and was batching them using the X-Rate-Limit-Reset returned from twitter via Reset data send from skybrud api. So when i got close to limit i would thread sleep for 13mins.
I recently ran the app again but this time my reset date - datetime.now was always a negative value. I found that the date coming back from twitter was not taking into account UK daylight saving time. Its April and in the UK we are not in summer time, so i have had to add 1 hr to the reset date and now all is working again. There are 2 problems in software working with dates and invalidating cache :-}
Regards
Ismail
Hi Ismail and thanks for reporting,
As far as I remember, the reset date is specified as UTC, so the date you check it against should also be UTC - eg.
DateTime.UtcNow
.Please let me know whether this works ;)
Anders,
Doh, i was doing:
Have updated to as you suggest DateTime.UtcNow all works nicely.
Cheers
Ismail
is working on a reply...