re-attempt DB fetch connection
This commit is contained in:
@@ -578,9 +578,27 @@ classdef DBHandler < handle
|
||||
execute(obj.conn, query);
|
||||
end
|
||||
|
||||
|
||||
function answer = fetch(obj, query)
|
||||
maxFast = 20; maxSlow = 30;
|
||||
for attempt = 1:maxSlow
|
||||
try
|
||||
answer = fetch(obj.conn, query);
|
||||
return
|
||||
catch ME
|
||||
if attempt < maxFast
|
||||
pause(1)
|
||||
else
|
||||
pause(10)
|
||||
end
|
||||
lastErr = ME;
|
||||
end
|
||||
end
|
||||
pause(60)
|
||||
error('Database fetch failed after %d attempts:\n%s', maxSlow, lastErr.getReport())
|
||||
end
|
||||
|
||||
|
||||
|
||||
function [result,query] = queryDB(obj, filterParams, selectedFields)
|
||||
% getPathsWithFlexibleFilter Retrieves values from Runs table with flexible filtering
|
||||
|
||||
Reference in New Issue
Block a user