Skip to content

Commit

Permalink
#2897 Do not request service on <clinit>
Browse files Browse the repository at this point in the history
Fixes #2897
  • Loading branch information
hurricup committed Sep 7, 2024
1 parent 0d8ff97 commit 97d8752
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2015-2023 Alexandr Evstigneev
* Copyright 2015-2024 Alexandr Evstigneev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,6 +24,7 @@
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.util.AtomicNotNullLazyValue;
import com.intellij.openapi.util.NlsSafe;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.text.StringUtil;
Expand All @@ -47,9 +48,9 @@ public abstract class PackageManagerAdapter {
public static final @NlsSafe String CPANMINUS_PACKAGE_NAME = "App::cpanminus";

private static final Logger LOG = Logger.getInstance(PackageManagerAdapter.class);
private static final MergingUpdateQueue QUEUE =
private static final AtomicNotNullLazyValue<MergingUpdateQueue> QUEUE_PROVIDER = AtomicNotNullLazyValue.createValue(() ->
new MergingUpdateQueue("perl.installer.queue", 300, true, null, PerlPluginUtil.getUnloadAwareDisposable())
.usePassThroughInUnitTestMode();
.usePassThroughInUnitTestMode());

private final @NotNull Sdk mySdk;

Expand Down Expand Up @@ -138,7 +139,7 @@ public void processTerminated(@NotNull ProcessEvent event) {
* @see #install(Collection, Runnable, boolean)
*/
public final void queueInstall(@NotNull Collection<String> packageNames, boolean suppressTests) {
QUEUE.queue(new InstallUpdate(this, packageNames, suppressTests));
QUEUE_PROVIDER.get().queue(new InstallUpdate(this, packageNames, suppressTests));
}

/**
Expand Down

0 comments on commit 97d8752

Please sign in to comment.