mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-14 08:41:28 +00:00
WebDavMounter warmUp in background thread.
This commit is contained in:
@@ -63,14 +63,12 @@ public final class FXThreads {
|
||||
* myLabel.setText(bookName);
|
||||
* });
|
||||
* </pre>
|
||||
*
|
||||
* @param executor
|
||||
* @param task The task to wait for.
|
||||
* @param successCallback The action to perform, when the task finished.
|
||||
*/
|
||||
public static <T> void runOnMainThreadWhenFinished(ExecutorService executor, Future<T> task, CallbackWhenTaskFinished<T> successCallback) {
|
||||
executor.submit(() -> {
|
||||
return "asd";
|
||||
});
|
||||
runOnMainThreadWhenFinished(executor, task, successCallback, DUMMY_EXCEPTION_CALLBACK);
|
||||
}
|
||||
|
||||
@@ -89,8 +87,7 @@ public final class FXThreads {
|
||||
* });
|
||||
* </pre>
|
||||
*
|
||||
* @param executor
|
||||
* The service to execute the background task on
|
||||
* @param executor The service to execute the background task on
|
||||
* @param task The task to wait for.
|
||||
* @param successCallback The action to perform, when the task finished.
|
||||
* @param exceptionCallback
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
******************************************************************************/
|
||||
package org.cryptomator.ui.util.mount;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.cryptomator.webdav.WebDavServer;
|
||||
@@ -24,9 +26,11 @@ public class WebDavMounterProvider implements Provider<WebDavMounter> {
|
||||
private final WebDavMounterStrategy choosenStrategy;
|
||||
|
||||
@Inject
|
||||
public WebDavMounterProvider(WebDavServer server) {
|
||||
public WebDavMounterProvider(WebDavServer server, ExecutorService executorService) {
|
||||
this.choosenStrategy = getStrategyWhichShouldWork();
|
||||
this.choosenStrategy.warmUp(server.getPort());
|
||||
executorService.execute(() -> {
|
||||
this.choosenStrategy.warmUp(server.getPort());
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user