#NEWLINE# def fail( self ) : #NEWLINE# #INDENT# super ( RandomExponentialBackoff , self ) . fail ( ) #NEWLINE# delay_scale = ( int ( ( 2 ** ( ( self . number_of_retries / 2.0 ) - 1 ) ) ) + 1 ) #NEWLINE# delay = ( delay_scale + random . randint ( 1 , delay_scale ) ) #NEWLINE# message = ( 'Sleeping for %ss [max %s] before retrying.' % ( delay , ( delay_scale * 2 ) ) ) #NEWLINE# try : #NEWLINE# #INDENT# logger . warning ( message ) #NEWLINE# #UNINDENT# except NameError : #NEWLINE# #INDENT# print ( message ) #NEWLINE# #UNINDENT# time . sleep ( delay )