Skip to content

Commit e580602

Browse files
authored
Merge pull request #86 from UMCUGenetics/hotfix/v1.10.1
Hotfix/v1.10.1
2 parents 60c4bf0 + ce8e355 commit e580602

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

clarity_epp.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import argparse
66

77
import genologics.lims
8+
from tenacity import Retrying, RetryError, stop_after_attempt, wait_fixed
89

910
import clarity_epp.upload
1011
import clarity_epp.export
@@ -13,10 +14,17 @@
1314

1415
import config
1516

16-
# Setup lims connection
17+
# Setup lims connection and try connection twice
1718
lims = genologics.lims.Lims(config.baseuri, config.username, config.password)
1819
genologics.lims.TIMEOUT = config.api_timeout
1920

21+
try:
22+
for lims_connection_attempt in Retrying(stop=stop_after_attempt(2), wait=wait_fixed(1)):
23+
with lims_connection_attempt:
24+
lims.check_version()
25+
except RetryError:
26+
raise Exception('Could not connect to Clarity LIMS.')
27+
2028

2129
# Export Functions
2230
def export_bioanalyzer(args):

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ argparse==1.4.0
33
xmltodict==0.12.0
44
pytest==7.0.1
55
pytest-mock==3.6.1
6+
tenacity==8.2.2

0 commit comments

Comments
 (0)