daily pastebin goal
70%
SHARE
TWEET

Untitled

a guest Oct 23rd, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. file_path_list = [os.path.join(sample.analysis.directory or '', file_name) for file_name in sample.status_files_upload.keys()]
  2. max_timeout = time() + Sample.TIMEOUT_SEG
  3. files_ready = lambda files: all([base_handler.exists_dir(file_path) for file_path in files])
  4.  
  5. while not files_ready(file_path_list) and time() < max_timeout:
  6.     sleep(60)  # espera 1 minuto antes de testar de novo
  7.    
  8. if not files_ready(file_path_list):
  9.     celery_logger.info('[!] Sample files not found')
  10.     sample.status = Sample.STATUS_TYPE.ERROR.value
  11.     sample.save(update_fields=['status'])
  12.     raise Exception('[!] Sample files not found')
  13.    
  14. # SEM ELSE!!
  15. # ...
  16. sample.execute()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top