reduce sleep when connecting to soffice from Java
500ms is an eternity on modern machines Change-Id: I7f16935e9b09c734d05d2430dc0efb3be44617b8 Reviewed-on: https://gerrit.libreoffice.org/16038 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
committed by
Stephan Bergmann
parent
bf93b3d1a4
commit
83f25d3c6e
@@ -318,22 +318,21 @@ public class LocalOfficeConnection
|
||||
aSOffice.startupService();
|
||||
|
||||
// wait until soffice is started
|
||||
long nMaxMillis = System.currentTimeMillis() + 1000L*aSOffice.getStartupTime();
|
||||
long nGiveUpTimeMillis = System.currentTimeMillis() + 1000L*aSOffice.getStartupTime();
|
||||
while ( aInitialObject == null )
|
||||
{
|
||||
try
|
||||
{
|
||||
Thread.currentThread();
|
||||
// try to connect to soffice
|
||||
Thread.sleep( 500 );
|
||||
Thread.sleep( 100 );
|
||||
aInitialObject = resolve(xLocalContext, mURL);
|
||||
}
|
||||
catch( com.sun.star.connection.NoConnectException aEx )
|
||||
{
|
||||
// soffice did not start in time
|
||||
if ( System.currentTimeMillis() > nMaxMillis )
|
||||
if ( System.currentTimeMillis() > nGiveUpTimeMillis )
|
||||
throw aEx;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user