Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Apr 24, 2015 @ 12:32
    Ismail Mayat
    0

    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

  • Anders Bjerner 487 posts 2989 karma points MVP 8x admin c-trib
    Apr 24, 2015 @ 13:02
    Anders Bjerner
    0

    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 ;)

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Apr 24, 2015 @ 13:09
    Ismail Mayat
    0

    Anders,

    Doh, i was doing:

     var resetDate = rate.Reset;
    
                        var now = DateTime.Now;

    Have updated to as you suggest DateTime.UtcNow all works nicely.

    Cheers

    Ismail

Please Sign in or register to post replies

Write your reply to:

Draft