Skip to content

Commit e286e59

Browse files
committed
Do not fail when closing the FTP connection
1 parent 30f5d77 commit e286e59

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

crawler/crawler-ftp/src/main/java/fr/pilato/elasticsearch/crawler/fs/crawler/ftp/FileAbstractorFTP.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,13 @@ public void open() throws IOException {
180180

181181
@Override
182182
public void close() throws IOException {
183-
if (ftp.isConnected()) {
184-
ftp.logout();
185-
ftp.disconnect();
183+
try {
184+
if (ftp.isConnected()) {
185+
ftp.logout();
186+
ftp.disconnect();
187+
}
188+
} catch (IOException e) {
189+
logger.warn("Error during FTP logout: {}", e.getMessage());
186190
}
187191
}
188192

0 commit comments

Comments
 (0)