private void cleanOldValues()

in server/src/jetbrains/buildServer/swabra/serverHealth/SwabraCleanCheckoutWatcherImpl.java [74:96]


  private void cleanOldValues(@NotNull final CleanupProcessState cleanupState) throws CleanupInterruptedException {
    final long now = System.currentTimeMillis();

    for (SProject project: myProjectManager.getActiveProjects()) {
      cleanupState.throwIfInterrupted();

      final CustomDataStorage storage = getDataStorage(project);
      final Map<String, String> values = storage.getValues();
      if (values == null) continue;

      for (Map.Entry<String, String> e : values.entrySet()) {
        cleanupState.throwIfInterrupted();

        if (isOldOrBad(e.getValue(), now) || myProjectManager.findBuildTypeById(e.getKey()) == null) {
          storage.putValue(e.getKey(), null);
        }
      }

      if (storage.getValues().isEmpty()) {
        storage.dispose();
      }
    }
  }