File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/main/java/org/embulk/output/sftp Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -218,11 +218,13 @@ private FileObject newSftpFile(URI sftpUri)
218218 logger .warn ("failed to connect sftp server: " + e .getMessage (), e );
219219
220220 try {
221- Thread .sleep (count * 1000 ); // milliseconds
221+ long sleepTime = ((long ) Math .pow (2 , count ) * 1000 );
222+ logger .warn ("sleep in next connection retry: {} milliseconds" , sleepTime );
223+ Thread .sleep (sleepTime ); // milliseconds
222224 }
223225 catch (InterruptedException e1 ) {
224- // Ignore this exception
225- logger .warn (e .getMessage (), e );
226+ // Ignore this exception because this exception is just about `sleep`.
227+ logger .warn (e1 .getMessage (), e1 );
226228 }
227229 logger .warn ("retry to connect sftp server: " + count + " times" );
228230 }
You can’t perform that action at this time.
0 commit comments