From 3d60673ae4d520a9b910c6b68d9a6d15286ff470 Mon Sep 17 00:00:00 2001 From: Orakaro Date: Sun, 11 Dec 2016 22:24:02 +0900 Subject: [PATCH] Exit While loop instead of hangup all application. --- rainbowstream/rainbow.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rainbowstream/rainbow.py b/rainbowstream/rainbow.py index 118667c6..a499f957 100644 --- a/rainbowstream/rainbow.py +++ b/rainbowstream/rainbow.py @@ -938,8 +938,9 @@ def ls(): # 300 users means 15 calls to the related API. The rate limit is 15 # calls per 15mn periods (see Twitter documentation). if ( number_of_users % 300 == 0 ): - printNicely( '(waiting 16mn for rate limits reasons...)' ) - time.sleep(16*60) + printNicely(light_yellow( 'We reached the limit of Twitter API.' )) + printNicely(light_yellow( 'You may need to wait about 15 minutes.' )) + break printNicely('All: ' + str(number_of_users) + ' ' + d[target] + '.')