parameters: ()
docstring: Reduce the cache size
docstring_summary: Reduce the cache size
docstring_tokens: Reduce the cache size
function: def lru_evict():
  	"""
  	Reduce the cache size
  	"""
  	lockfile = os.path.join(CACHE_DIR, 'all.lock')
  	try:
  		st = os.stat(lockfile)
  	except EnvironmentError as e:
  		if e.errno == errno.ENOENT:
  			with open(lockfile, 'w') as f:
  				f.write('')
  			return
  		else:
  			raise
  
  	if st.st_mtime < time.time() - EVICT_INTERVAL_MINUTES * 60:
  		# check every EVICT_INTERVAL_MINUTES minutes if the cache is too big
  		# OCLOEXEC is unnecessary because no processes are spawned
  		fd = os.open(lockfile, os.O_RDWR | os.O_CREAT, 0o755)
  		try:
  			try:
  				fcntl.flock(fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
  			except EnvironmentError:
  				if WAFCACHE_VERBOSITY:
  					sys.stderr.write('wafcache: another cleaning process is running\n')
  			else:
  				# now dow the actual cleanup
  				lru_trim()
  				os.utime(lockfile, None)
  		finally:
  			os.close(fd)
function_tokens: def lru_evict ( ) : lockfile = os . path . join ( CACHE_DIR , 'all.lock' ) try : st = os . stat ( lockfile ) except EnvironmentError as e : if e . errno == errno . ENOENT : with open ( lockfile , 'w' ) as f : f . write ( '' ) return else : raise if st . st_mtime < time . time ( ) - EVICT_INTERVAL_MINUTES * 60 : # check every EVICT_INTERVAL_MINUTES minutes if the cache is too big # OCLOEXEC is unnecessary because no processes are spawned fd = os . open ( lockfile , os . O_RDWR | os . O_CREAT , 0o755 ) try : try : fcntl . flock ( fd , fcntl . LOCK_EX | fcntl . LOCK_NB ) except EnvironmentError : if WAFCACHE_VERBOSITY : sys . stderr . write ( 'wafcache: another cleaning process is running\n' ) else : # now dow the actual cleanup lru_trim ( ) os . utime ( lockfile , None ) finally : os . close ( fd )