FastGithub/FastGithub/VersonHostedService.cs
2021-09-08 10:38:40 +08:00

30 lines
887 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using System.Threading;
using System.Threading.Tasks;
namespace FastGithub
{
sealed class VersonHostedService : IHostedService
{
private readonly ILogger<VersonHostedService> logger;
public VersonHostedService(ILogger<VersonHostedService> logger)
{
this.logger = logger;
}
public Task StartAsync(CancellationToken cancellationToken)
{
var version = ProductionVersion.Current;
this.logger.LogInformation($"{nameof(FastGithub)}启动完成当前版本为v{version}访问https://github.com/dotnetcore/FastGithub关注新版本");
return Task.CompletedTask;
}
public Task StopAsync(CancellationToken cancellationToken)
{
return Task.CompletedTask;
}
}
}