File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
3
import asyncio
4
+ import concurrent .futures
4
5
import copy
5
6
import dataclasses
6
7
import functools
@@ -88,6 +89,11 @@ class ErtRunError(Exception):
88
89
pass
89
90
90
91
92
+ def delete_runpath (run_path : str ) -> None :
93
+ if os .path .exists (run_path ):
94
+ shutil .rmtree (run_path )
95
+
96
+
91
97
class _LogAggregration (logging .Handler ):
92
98
def __init__ (self , messages : MutableSequence [str ]) -> None :
93
99
self .messages = messages
@@ -696,9 +702,8 @@ def get_number_of_successful_realizations(self) -> int:
696
702
697
703
@log_duration (logger , logging .INFO )
698
704
def rm_run_path (self ) -> None :
699
- for run_path in self .paths :
700
- if Path (run_path ).exists ():
701
- shutil .rmtree (run_path )
705
+ with concurrent .futures .ThreadPoolExecutor () as executor :
706
+ executor .map (delete_runpath , self .paths )
702
707
703
708
def validate_successful_realizations_count (self ) -> None :
704
709
successful_realizations_count = self .get_number_of_successful_realizations ()
You can’t perform that action at this time.
0 commit comments