src/main/java/au/org/dcw/twitter/ingest/FetchTweets.java
private void maybeDoze(final RateLimitStatus status) {
        if (status == null) { return; }

        final int secondsUntilReset = status.getSecondsUntilReset();
        final int callsRemaining = status.getRemaining();
        if (secondsUntilReset < 10 || callsRemaining < 10) {
            final int untilReset = status.getSecondsUntilReset() + 5;
            System.out.printf("Rate limit reached. Waiting %d seconds starting at %s...\n", untilReset, new Date());
            try {
                Thread.sleep(untilReset * 1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("Resuming...");
        }
    }
/**
     * If the provided {@link RateLimitStatus} indicates that we are about to exceed the rate
     * limit, in terms of number of calls or time window, then sleep for the rest of the period.
     *
     * @param status The current rate limit status of our calls to Twitter
     */
If the provided  RateLimitStatus indicates that we are about to exceed the rate
limit, in terms of number of calls or time window, then sleep for the rest of the period.

@param status The current rate limit status of our calls to Twitter
If the provided RateLimitStatus indicates that we are about to exceed the rate limit in terms of number of calls or time window then sleep for the rest of the period . @param status The current rate limit status of our calls to Twitter
private void maybeDoze(final RateLimitStatus status) {
        if (status == null) { return; }
        final int secondsUntilReset = status.getSecondsUntilReset();
        final int callsRemaining = status.getRemaining();
        if (secondsUntilReset < 10 || callsRemaining < 10) {
            final int untilReset = status.getSecondsUntilReset() + 5;
            System.out.printf("Rate limit reached. Waiting %d seconds starting at %s...\n", untilReset, new Date());
            try {
                Thread.sleep(untilReset * 1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("Resuming...");
        }
    }
private void maybeDoze ( final RateLimitStatus status ) { if ( status == null ) { return ; } final int secondsUntilReset = status . getSecondsUntilReset ( ) ; final int callsRemaining = status . getRemaining ( ) ; if ( secondsUntilReset < 10 || callsRemaining < 10 ) { final int untilReset = status . getSecondsUntilReset ( ) + 5 ; System . out . printf ( "Rate limit reached. Waiting %d seconds starting at %s...\n" , untilReset , new Date ( ) ) ; try { Thread . sleep ( untilReset * 1000 ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } System . out . println ( "Resuming..." ) ; } }
If the provided {@link RateLimitStatus} indicates that we are about to exceed the rate
 limit, in terms of number of calls or time window, then sleep for the rest of the period.
If the provided { @link RateLimitStatus } indicates that we are about to exceed the rate limit in terms of number of calls or time window then sleep for the rest of the period .