code: public Long getDurationOfLastSuccessfulOnAgent(String pipelineName, String stageName, JobInstance job) {
          String key = job.getBuildDurationKey(pipelineName, stageName);
          Long duration;
          try {
              duration = (Long) cache.getFromCache(key, CacheEntry.INDEFINITE_EXPIRY);
          } catch (NeedsRefreshException nre) {
              boolean updated = false;
              try {
                  duration = recalculateBuildDuration(pipelineName, stageName, job);
                  cache.putInCache(key, duration);
                  updated = true;
              } finally {
                  if (!updated) {
                      // It is essential that cancelUpdate is called if the
                      // cached content could not be rebuilt
                      cache.cancelUpdate(key);
                      LOGGER.warn("refresh cancelled for {}", key);
                  }
              }
          }
          return duration;
      }
docs: TODO: to show because of this implementation