void (@NotNull ProgressIndicator indicator) { long time = myIndexingTime.get(myRoot).get() + (getCurrentTimeMillis() - myStartTime); int limit = myIndexingLimit.get(myRoot).get(); boolean isBigRoot = myBigRepositoriesList.isBig(myRoot); boolean isOvertime = !myIdleIndexer.isEnabled() && (limit > 0 && time >= (Math.max(limit, 1L) * 60 * 1000) && !isBigRoot); if (isOvertime || (isBigRoot && !indicator.isCanceled())) { mySpan.setAttribute("cancelled", true); String cause = isOvertime ? "by timeout (" + limit + " min)" : "externally"; LOG.warn("Indexing " + myRoot.getName() + " was cancelled " + cause + " after " + StopWatch.formatTime(time)); if (!isBigRoot) { myBigRepositoriesList.addRepository(myRoot); } if (isOvertime) { myIndexingLimit.get(myRoot).compareAndSet(limit, Math.max(limit + getIndexingLimit(), (int)((time / (getIndexingLimit() * 60000) + 1) * getIndexingLimit()))); } indicator.cancel(); } }