Force _IsWindowsService and change log level
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
using File_Watcher.Models;
|
||||
using Microsoft.Extensions.Hosting.WindowsServices;
|
||||
using System.Data;
|
||||
|
||||
namespace File_Watcher;
|
||||
|
||||
@ -41,6 +42,8 @@ public partial class Worker : BackgroundService
|
||||
|
||||
private async Task Body(CancellationToken stoppingToken)
|
||||
{
|
||||
if (!_IsWindowsService)
|
||||
throw new EvaluateException("Set break point and skip!");
|
||||
while (_IsWindowsService && !stoppingToken.IsCancellationRequested)
|
||||
{
|
||||
Body();
|
||||
|
Reference in New Issue
Block a user