time.sleep(sleep_time + 5) # sleep for few extra sec
There is no real reason to have the +5 extra seconds for sleep time. Based on Twitter headers for rate limit reset purposes, a value of +1 would be sufficient to cover any "fuzzyness" between clocks. If this is set to account for server clock drift, it really should be on the sysadmin to correct this.
The extra 4 seconds of waiting can add up for long running search jobs ingesting a lot of tweets were every active second counts. That's over 6 minutes of wasted idle time per 24 hour period.
There is no real reason to have the +5 extra seconds for sleep time. Based on Twitter headers for rate limit reset purposes, a value of +1 would be sufficient to cover any "fuzzyness" between clocks. If this is set to account for server clock drift, it really should be on the sysadmin to correct this.
The extra 4 seconds of waiting can add up for long running search jobs ingesting a lot of tweets were every active second counts. That's over 6 minutes of wasted idle time per 24 hour period.