Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

581 B
Raw Blame
using Grand.Business.Core.Interfaces.System.ScheduleTasks;
using Grand.Infrastructure.Caching;

namespace Grand.Module.ScheduledTasks.BackgroundServices;

/// <summary>
///     Clear cache scheduled task implementation
/// </summary>
public class ClearCacheScheduleTask : IScheduleTask
{
    private readonly ICacheBase _cacheBase;

    public ClearCacheScheduleTask(ICacheBase cacheBase)
    {
        _cacheBase = cacheBase;
    }

    /// <summary>
    ///     Executes a task
    /// </summary>
    public async Task Execute()
    {
        await _cacheBase.Clear();
    }
}