File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 1
1
import subprocess
2
2
from pathlib import Path
3
3
from tempfile import TemporaryDirectory
4
+ from time import sleep
5
+ from warnings import warn
4
6
5
7
HERE = Path (__file__ ).parent
6
8
EXAMPLE = HERE .parent / "atest/examples/example.tex"
9
+ ATTEMPTS = 3
10
+ SLEEP = 5
7
11
8
12
9
13
def tectonic_cache ():
@@ -21,7 +25,17 @@ def tectonic_cache():
21
25
]
22
26
)
23
27
)
24
- subprocess .check_call (["tectonic" , str (tex )], cwd = td )
28
+ for attempt in range (ATTEMPTS ):
29
+ try :
30
+ subprocess .check_call (["tectonic" , str (tex )], cwd = td )
31
+ break
32
+ except subprocess .CalledProcessError as e :
33
+ warn (
34
+ "Tectonic cache attempt {attempt} failed: {e}, retrying in {time} seconds" .format (
35
+ e = e , attempt = attempt , time = SLEEP
36
+ )
37
+ )
38
+ sleep (SLEEP )
25
39
26
40
27
41
if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments