parameters: (self, window=SCAN_TTL)
docstring: Clear scan pools generated before time window,
          Clear all scan pools if window is -1.
docstring_summary: Clear scan pools generated before time window,
          Clear all scan pools if window is -1.
docstring_tokens: Clear scan pools generated before time window Clear all scan pools if window is - 1 .
function: def clean_stale(self, window=SCAN_TTL):
          """
          Clear scan pools generated before time window,
          Clear all scan pools if window is -1.
          """
          try:
              now = time.time()
              clean_list = glob.glob('/tmp/kimchi-scan-*')
              for d in clean_list:
                  transient_pool = os.path.basename(
                      d).replace('kimchi-scan-', '')[0:-6]
                  if now - os.path.getmtime(d) > window:
                      shutil.rmtree(d)
                      self.clean_cb(transient_pool)
          except OSError as e:
              msg = f'Exception {e} occured when cleaning stale pool, ignore'
              wok_log.debug(msg)
function_tokens: def clean_stale ( self , window = SCAN_TTL ) : try : now = time . time ( ) clean_list = glob . glob ( '/tmp/kimchi-scan-*' ) for d in clean_list : transient_pool = os . path . basename ( d ) . replace ( 'kimchi-scan-' , '' ) [ 0 : - 6 ] if now - os . path . getmtime ( d ) > window : shutil . rmtree ( d ) self . clean_cb ( transient_pool ) except OSError as e : msg = f'Exception {e} occured when cleaning stale pool, ignore' wok_log . debug ( msg )