2 Commits c013dd436a ... 7f28781010

Author SHA1 Message Date
  Andrej 7f28781010 Adding timeout to orthancQR removeModality 1 month ago
  Andrej 5dbd99dbc1 Adding timeout to orthancInterface delete 1 month ago
2 changed files with 3 additions and 3 deletions
  1. 2 2
      orthancInterface.py
  2. 1 1
      orthancQR.py

+ 2 - 2
orthancInterface.py

@@ -97,7 +97,7 @@ class orthancInterface:
             print(e)
      
 
-    def delete(self,url):
+    def delete(self,url,timeout=None):
 
         debug=False
         if debug:
@@ -105,7 +105,7 @@ class orthancInterface:
         
         headers=urllib3.util.make_headers(basic_auth=self.getBasicAuth())
         try:
-            return self.http.request('DELETE',url,headers=headers)
+            return self.http.request('DELETE',url,headers=headers,timeout=timeout)
         except urllib3.exceptions.HTTPError as e:
             print(e)
             return None

+ 1 - 1
orthancQR.py

@@ -19,7 +19,7 @@ class orthancQR:
 
    def removeModality(self,name):
       apiURL='/'.join([self.net.getCoreURL(),'modalities',name])
-      response=self.net.delete(apiURL)
+      response=self.net.delete(apiURL,timeout=urllib3.util.Timeout(read=0.5))
 
    def cEcho(self,name):
       apiURL='/'.join([self.net.getCoreURL(),'modalities',name,'echo'])