using System; using Cronos; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using ServiceWorkerCronJobDemo.Services; namespace VestalisQuintet.VQCalendarAttention { public class CalendarAttentionService : CronJobService { private readonly IServiceProvider _serviceProvider; public CalendarAttentionService(CronExpression expression, TimeZoneInfo timeZoneInfo, IServiceProvider serviceProvider) : base(expression, timeZoneInfo) { _serviceProvider = serviceProvider; } public override async Task DoWork(CancellationToken cancellationToken) { // ここにCronジョブで実行する処理を実装します。 Console.WriteLine("Cron job executed at: " + DateTimeOffset.Now); await Task.CompletedTask; } } }