2017-02-22 119 views
0

Python 2.7,試圖用shutil.rmtree()刪除一個大文件夾會產生超時。 如何設置超時或讓操作一直運行直到完成?python shutil.rmtree - 如何刪除/設置超時?

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) 

謝謝

回答

0

這是RQ例外。 因此,從Django Admin可以在RQ可重複工作對象上設置超時。 enter image description here