BirthdayBot/BackgroundServices/BackgroundService.cs

13 lines
494 B
C#
Raw Normal View History

2022-03-21 19:11:30 +00:00
namespace BirthdayBot.BackgroundServices;
abstract class BackgroundService {
protected static SemaphoreSlim DbConcurrentOperationsLock { get; } = new(ShardManager.MaxConcurrentOperations);
protected ShardInstance ShardInstance { get; }
public BackgroundService(ShardInstance instance) => ShardInstance = instance;
protected void Log(string message) => ShardInstance.Log(GetType().Name, message);
public abstract Task OnTick(int tickCount, CancellationToken token);
}