boolean (@NotNull PyPackageManager manager, @NotNull AtomicBoolean isUpdating) { ApplicationManager.getApplication().assertIsNonDispatchThread(); if (!isUpdating.compareAndSet(false, true)) { return false; } try { if (manager instanceof PyPackageManagerImpl) { LOG.info("Refreshing installed packages for SDK " + manager.getSdk().getHomePath()); } manager.refreshAndGetPackages(true); } catch (ExecutionException ignored) { } finally { isUpdating.set(false); } return true; }