using Microsoft.Extensions.Hosting;

namespace molilian.core
{
    public class TaskWorker : BackgroundService
    {
        protected override async Task ExecuteAsync(CancellationToken stoppingToken)
        {
#if DEBUG
#else
            while (!stoppingToken.IsCancellationRequested)
            {
                //var tasks = new List<Task>();
                try
                {
                    TkLogCore.BatchInsertLogDB(100);
                }
                catch { }
                //await Task.WhenAll(tasks);
                await Task.Delay(5 * 1000, stoppingToken);
            }
#endif
        }

    }
}
