#NEWLINE# def add_attempt( self , exception , traceb , date = None ) : #NEWLINE# #INDENT# self . current_attempt += 1 #NEWLINE# self . total_attempts += 1 #NEWLINE# self . date_last_attempt = ( date or datetime . utcnow ( ) ) #NEWLINE# self . error_type = path_from_object ( exception ) #NEWLINE# self . error_traceback = '{}\n\n{}' . format ( exception . message , '' . join ( traceback . format_tb ( traceb ) ) ) #NEWLINE# if ( self . current_attempt <= settings . PILLOW_RETRY_QUEUE_MAX_PROCESSING_ATTEMPTS ) : #NEWLINE# #INDENT# time_till_next = ( settings . PILLOW_RETRY_REPROCESS_INTERVAL * math . pow ( self . current_attempt , settings . PILLOW_RETRY_BACKOFF_FACTOR ) ) #NEWLINE# self . date_next_attempt = ( self . date_last_attempt + timedelta ( minutes = time_till_next ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . date_next_attempt = None