@@ -421,6 +421,12 @@ void ApiListener::HandleConfigUpdate(const MessageOrigin::Ptr& origin, const Dic
421421 Dictionary::Ptr productionConfig = MergeConfigUpdate (productionConfigInfo);
422422 Dictionary::Ptr newConfig = MergeConfigUpdate (newConfigInfo);
423423
424+ bool timestampChanged = false ;
425+
426+ if (CompareTimestampsConfigChange (productionConfig, newConfig, stageConfigZoneDir)) {
427+ timestampChanged = true ;
428+ }
429+
424430 /* If we have received 'checksums' via cluster message, go for it.
425431 * Otherwise do the old timestamp dance for versions < 2.11.
426432 */
@@ -429,7 +435,7 @@ void ApiListener::HandleConfigUpdate(const MessageOrigin::Ptr& origin, const Dic
429435 << " Received configuration for zone '" << zoneName << " ' from endpoint '"
430436 << fromEndpointName << " '. Comparing the timestamp and checksums." ;
431437
432- if (CompareTimestampsConfigChange (productionConfig, newConfig, stageConfigZoneDir) ) {
438+ if (timestampChanged ) {
433439
434440 if (CheckConfigChange (productionConfigInfo, newConfigInfo))
435441 configChange = true ;
@@ -446,7 +452,7 @@ void ApiListener::HandleConfigUpdate(const MessageOrigin::Ptr& origin, const Dic
446452 << " Received configuration update without checksums from parent endpoint "
447453 << fromEndpointName << " . This behaviour is deprecated. Please upgrade the parent endpoint to 2.11+" ;
448454
449- if (CompareTimestampsConfigChange (productionConfig, newConfig, stageConfigZoneDir) ) {
455+ if (timestampChanged ) {
450456 configChange = true ;
451457 }
452458
@@ -508,8 +514,8 @@ void ApiListener::HandleConfigUpdate(const MessageOrigin::Ptr& origin, const Dic
508514 << " Applying configuration file update for path '" << stageConfigZoneDir << " ' ("
509515 << numBytes << " Bytes)." ;
510516
511- // If the update removes a path, delete it on disk and signal a config change.
512- {
517+ if (timestampChanged) {
518+ // If the update removes a path, delete it on disk and signal a config change.
513519 ObjectLock xlock (productionConfig);
514520
515521 for (const Dictionary::Pair& kv : productionConfig) {
0 commit comments