Add connection.disconnect() in finally blocks (#2189)

This commit is contained in:
Lai Jiang 2023-10-23 16:38:16 -04:00 committed by GitHub
parent fe710e5510
commit d210bed744
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 0 deletions

View file

@ -121,6 +121,8 @@ public final class Marksdb {
return getResponseBytes(connection);
} catch (IOException e) {
throw new IOException(String.format("Error connecting to MarksDB at URL %s", url), e);
} finally {
connection.disconnect();
}
}

View file

@ -225,6 +225,8 @@ public final class NordnUploadAction implements Runnable {
cloudTasksUtils.enqueue(NordnVerifyAction.QUEUE, makeVerifyTask(new URL(location)));
} catch (IOException e) {
throw new IOException(String.format("Error connecting to MarksDB at URL %s", url), e);
} finally {
connection.disconnect();
}
}

View file

@ -148,6 +148,8 @@ public final class NordnVerifyAction implements Runnable {
return log;
} catch (IOException e) {
throw new IOException(String.format("Error connecting to MarksDB at URL %s", url), e);
} finally {
connection.disconnect();
}
}
}