简体   繁体   中英

python shutil.rmtree - how to remove/set timeout?

Python 2.7, Trying to delete a large folder with shutil.rmtree() yields timeout. How is it possible to set the timeout or have the operation run until it finishes?

File "/var/www/fat/fatsite/analysis_retention/analysis_retention_handler.py", line 29, in delete_old_analysis
    shutil.rmtree(analysis_to_delete.output_path)
  File "/usr/lib/python2.7/shutil.py", line 250, in rmtree
    os.remove(fullname)
  File "/home/fat/envs/py2.7/lib/python2.7/site-packages/rq/timeouts.py", line 51, in handle_death_penalty
    'value ({0} seconds)'.format(self._timeout))
JobTimeoutException: Job exceeded maximum timeout value (180 seconds)

Thank you

This is an RQ exception. So it is possible from the Django Admin to set a timeout on the RQ repeatable job object. 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM