File tree Expand file tree Collapse file tree
aidbox-custom-operations/measure-evaluate Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,7 +104,14 @@ def load_bundle(filepath, label):
104104 except Exception :
105105 pass
106106
107- print (f" OK { label } — { loaded } /{ loaded + failed } entries" )
107+ total = loaded + failed
108+ if loaded == 0 :
109+ status = "FAIL"
110+ elif failed == 0 :
111+ status = "OK"
112+ else :
113+ status = "PARTIAL"
114+ print (f" { status } { label } — { loaded } /{ total } entries" )
108115
109116
110117def populate_concepts (valueset_path ):
@@ -176,6 +183,12 @@ def execute_sql_file(filepath, label):
176183 return
177184 with open (filepath ) as f :
178185 content = f .read ()
186+ # Prepend lock_timeout so that DROP VIEW / DROP TABLE statements give up
187+ # promptly when something else is holding a conflicting lock, instead of
188+ # queueing on the server for hours after our HTTP client has already
189+ # timed out. lock_timeout only applies to lock acquisition — long ANALYZE
190+ # statements are not affected.
191+ content = "SET LOCAL lock_timeout = '60s';\n " + content
179192 try :
180193 # Aidbox $sql wraps the whole call in one transaction — a mid-file
181194 # error rolls back every preceding statement, so this is safe to retry.
You can’t perform that action at this time.
0 commit comments