External settings clean up agent

Abstract

A Sitecore agent is provided to clean up and maintain the external settings catalog.

Over time, as your catalog is updated, it is possible that the external settings catalog will contain Categories, Products and Variants that no longer exist in the main catalog. To help clean up and maintain the external settings catalog, a Sitecore agent is provided. By default, the agent is configured to run at specific intervals to scan and clean up unwanted entries from the external settings catalog. The agent traverses the external settings catalog and tries to locate each category, product and variant in encounters. Any item that is not found in the originating catalog is removed from the external settings catalog.

The following configuration is found in the CommerceServer.config file:

<scheduling>
<agent type="Sitecore.Commerce.Connect.CommerceServer.Agents.CleanupExternalSettingsAgent,
        Sitecore.Commerce.Connect.CommerceServer" method="Run" interval="00:00:00">
        <ShouldLogActivity>True</ShouldLogActivity>
      </agent>
</scheduling>

As show in the example, an interval of “00:00:00” disables the agent. The ShouldLogActivity flag is used to log information about the agent as the catalogs are cleaned. Logging includes the start and stop of the processing of the catalogs as well as the Category, Product and Variants that were removed.