- Category::getInstance(SAML_LOGCAT".MetadataProvider.Dynamic").error(
- "error while resolving entityID (%s): %s", name.c_str(), e.what()
- );
+ log.error("error while resolving entityID (%s): %s", name.c_str(), e.what());
+ // This will return entries that are beyond their cache period,
+ // but not beyond their validity unless that criteria option was set.
+ // If it is a cache-expired entry, bump the cache period to prevent retries.
+ if (entity.first) {
+ time_t cacheExp = 600;
+ if (entity.first->getCacheDuration())
+ cacheExp = min(m_maxCacheDuration, entity.first->getCacheDurationEpoch());
+ cacheExp = max(cacheExp, 60);
+ m_cacheMap[entity.first->getEntityID()] = time(nullptr) + cacheExp;
+ }