void () { synchronized (ourLock) { if (myPreparing) { return; } myPreparing = true; myCache = null; } // for example, if executed as part of Traverse UI - don't wait check updates if (ApplicationManager.getApplication().isHeadlessEnvironment()) { return; } NonUrgentExecutor.getInstance().execute(() -> { List<IdeaPluginDescriptor> cache = ContainerUtil.map(UpdateChecker.getInternalPluginUpdates().getPluginUpdates().getAll(), PluginDownloader::getDescriptor); ApplicationManager.getApplication().invokeLater(() -> { synchronized (ourLock) { myPreparing = false; if (myReset) { myReset = false; calculateUpdates(); return; } myPrepared = true; myCache = cache; Integer countValue = getCount(); for (PluginUpdatesService service : SERVICES) { service.runAllCallbacks(countValue); } } }, ModalityState.any()); }); }