Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

ClearCacheTask.cs

using Nop.Core.Caching;
using Nop.Services.ScheduleTasks;

namespace Nop.Services.Caching;

/// 
/// Clear cache scheduled task implementation
/// 
public partial class ClearCacheTask : IScheduleTask
{
    #region Fields

    protected readonly IStaticCacheManager _staticCacheManager;

    #endregion

    #region Ctor

    public ClearCacheTask(IStaticCacheManager staticCacheManager)
    {
        _staticCacheManager = staticCacheManager;
    }

    #endregion

    #region Methods

    /// 
    /// Executes a task
    /// 
    public async System.Threading.Tasks.Task ExecuteAsync()
    {
        await _staticCacheManager.ClearAsync();
    }

    #endregion
}