#NEWLINE# def main( script , opts , args ) : #NEWLINE# #INDENT# two_days_ago = ( datetime . datetime . now ( ) - datetime . timedelta ( days = 2 ) ) #NEWLINE# last_key = two_days_ago . strftime ( '%Y-%m-%d:%H:%M' ) #NEWLINE# redis = script . redis #NEWLINE# tables = ( 'lookups.time.ms' , 'lookups.time.count' ) #NEWLINE# for table in tables : #NEWLINE# #INDENT# to_delete = [ ] #NEWLINE# for key in redis . hkeys ( table ) : #NEWLINE# #INDENT# if ( key < last_key ) : #NEWLINE# #INDENT# to_delete . append ( key ) #NEWLINE# #UNINDENT# #UNINDENT# if to_delete : #NEWLINE# #INDENT# for table in tables : #NEWLINE# #INDENT# for field in to_delete : #NEWLINE# #INDENT# redis . hdel ( table , field )