PluralKit/PluralKit.Core/Utils/DatabaseUtils.cs

23 lines
457 B
C#

using System.Data;
using System.Threading;
using Dapper;
namespace PluralKit.Core
{
public class DbConnectionCountHolder
{
private int _connectionCount;
public int ConnectionCount => _connectionCount;
public void Increment()
{
Interlocked.Increment(ref _connectionCount);
}
public void Decrement()
{
Interlocked.Decrement(ref _connectionCount);
}
}
}