mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-02-19 15:39:13 -05:00
24 lines
911 B
C#
24 lines
911 B
C#
//-----------------------------------------------------------------------
|
|
// <copyright file="TestExceptionWorker.cs" company="aliasvault">
|
|
// Copyright (c) aliasvault. All rights reserved.
|
|
// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.
|
|
// </copyright>
|
|
//-----------------------------------------------------------------------
|
|
|
|
namespace AliasVault.IntegrationTests.StatusHostedService;
|
|
|
|
using Microsoft.Extensions.Hosting;
|
|
|
|
/// <summary>
|
|
/// A simple worker that throws an exception during task execution. This is used for testing purposes.
|
|
/// </summary>
|
|
public class TestExceptionWorker() : BackgroundService
|
|
{
|
|
/// <inheritdoc/>
|
|
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
|
{
|
|
await Task.Delay(TimeSpan.FromMilliseconds(100), stoppingToken);
|
|
throw new Exception("Test exception");
|
|
}
|
|
}
|