@sopel.module.interval(((24 * 60) * 60))
def _clean_cache(bot):
 oldest_key_age = 0
 oldest_key = u''
 for (key, data) in sopel.tools.iteritems(bot.memory[u'safety_cache']):
  if (data[u'age'] > oldest_key_age):
   oldest_key_age = data[u'age']
   oldest_key = key
 if (oldest_key in bot.memory[u'safety_cache']):
  del bot.memory[u'safety_cache'][oldest_key]

@ sopel . module . interval ( ( ( 24 * 60 ) * 60 ) ) def _clean_cache ( bot ) : oldest_key_age = 0 oldest_key = u'' for ( key , data ) in sopel . tools . iteritems ( bot . memory [ u'safety_cache' ] ) : if ( data [ u'age' ] > oldest_key_age ) : oldest_key_age = data [ u'age' ] oldest_key = key if ( oldest_key in bot . memory [ u'safety_cache' ] ) : del bot . memory [ u'safety_cache' ] [ oldest_key ]
cleanup old entries in url cache .