private static void calculateUpdates() {
    synchronized (ourLock) {
      if (ourPreparing) {
        return;
      }
      ourPreparing = true;
      ourAllUpdates = null;
    }
    // for example, if executed as part of Traverse UI - don't wait check updates
    if (ApplicationManager.getApplication().isHeadlessEnvironment()) {
      return;
    }

    NonUrgentExecutor.getInstance().execute(() -> {
      final InternalPluginResults updates = UpdateChecker.getInternalPluginUpdates();
      ApplicationManager.getApplication().invokeLater(() -> {
        synchronized (ourLock) {
          ourPreparing = false;
          if (ourReset) {
            ourReset = false;
            calculateUpdates();
            return;
          }
          ourPrepared = true;
          ourAllUpdates = updates;
          final var filteredUpdates = getFilteredUpdateResult();
          for (PluginUpdatesService service : SERVICES) {
            service.runAllCallbacks(filteredUpdates);
          }
        }
      }, ModalityState.any());
    });
  }
private static void calculateUpdates()