title: ASP.Net Core BackgroundService is cancelled without reason
body: <p>I developed a BackgroundService, at the beginning it works Ok. But later at 20 minutes this is cancelled for some reason that I don't know.
  For this case in particular, the "job" should be infinite and never finish. Please, could  you give some idea ? I'll appreciate it</p>
  
  <pre><code>public class CheckItemsService : BackgroundService
  {
      private IConfiguration Configuration { get; }
  
      public CheckItemsService(IConfiguration configuration)
      {
          Configuration = configuration;
      }
  
      protected override async Task ExecuteAsync(CancellationToken stoppingToken)
      {
          stoppingToken.Register(() =&gt; Log.Information("Job is stopping"));
  
          while (!stoppingToken.IsCancellationRequested)
          {
              await UpdateItems();
  
              await Task.Delay(1000 * 60, stoppingToken);
          }
      }
  
      private async Task UpdateItems()
      {
          var optionsBuilder = new DbContextOptionsBuilder&lt;WalletContext&gt;();
          optionsBuilder.UseSqlServer(Configuration.GetSection("ConnectionStrings:Default").Value);
          DbContext _context = new DbContext(optionsBuilder.Options);
  
          var items = await _context.EntityX.ToListAsync();
  
          foreach (var item in items)
          {
              item.ModificationDate = DateTime.Now;
          }
  
          try
          {
              await _context.SaveChangesAsync();
          }
          catch (DbUpdateException dbEx)
          {
              Log.Information(dbEx.Message);
          }
      }
  }
  </code></pre>