From 83f25d3c6e0918a1d29aa3a923b7f35f0b8a55e2 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 2 Jun 2015 09:48:08 +0200 Subject: 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 Tested-by: Stephan Bergmann --- bean/com/sun/star/comp/beans/LocalOfficeConnection.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'bean') diff --git a/bean/com/sun/star/comp/beans/LocalOfficeConnection.java b/bean/com/sun/star/comp/beans/LocalOfficeConnection.java index c6f6fa3b0eb2..117ff39e129d 100644 --- a/bean/com/sun/star/comp/beans/LocalOfficeConnection.java +++ b/bean/com/sun/star/comp/beans/LocalOfficeConnection.java @@ -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; - } } } -- cgit