Kaydet (Commit) 83f25d3c authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Stephan Bergmann

reduce sleep when connecting to soffice from Java

500ms is an eternity on modern machines

Change-Id: I7f16935e9b09c734d05d2430dc0efb3be44617b8
Reviewed-on: https://gerrit.libreoffice.org/16038Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
Tested-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst bf93b3d1
...@@ -318,22 +318,21 @@ public class LocalOfficeConnection ...@@ -318,22 +318,21 @@ public class LocalOfficeConnection
aSOffice.startupService(); aSOffice.startupService();
// wait until soffice is started // wait until soffice is started
long nMaxMillis = System.currentTimeMillis() + 1000L*aSOffice.getStartupTime(); long nGiveUpTimeMillis = System.currentTimeMillis() + 1000L*aSOffice.getStartupTime();
while ( aInitialObject == null ) while ( aInitialObject == null )
{ {
try try
{ {
Thread.currentThread(); Thread.currentThread();
// try to connect to soffice // try to connect to soffice
Thread.sleep( 500 ); Thread.sleep( 100 );
aInitialObject = resolve(xLocalContext, mURL); aInitialObject = resolve(xLocalContext, mURL);
} }
catch( com.sun.star.connection.NoConnectException aEx ) catch( com.sun.star.connection.NoConnectException aEx )
{ {
// soffice did not start in time // soffice did not start in time
if ( System.currentTimeMillis() > nMaxMillis ) if ( System.currentTimeMillis() > nGiveUpTimeMillis )
throw aEx; throw aEx;
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment