using JiShe.ServicePro.Core;
using JiShe.ServicePro.DeviceManagement.Focuses;
using JiShe.ServicePro.DeviceManagement.Meters;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JiShe.IoT.Jobs.ToRedis
{
///
/// 缓存集中器数据到Redis
///
public class CacheFocusDataToRedisJob : SystemBackGroundWorkService
{
private readonly ILogger _logger;
public readonly FocusAppService _focusAppService;
public CacheFocusDataToRedisJob(ILogger logger, FocusAppService focusAppService) : base(logger)
{
_logger = logger;
_focusAppService= focusAppService;
}
protected override Task DoWorkAsync(CancellationToken cancellationToken)
{
return _focusAppService.CacheFocusDataToRedisAsync();
}
protected override TimeSpan GetInterval()
{
return TimeSpan.FromHours(1);
}
}
}