mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-14 17:50:13 +00:00
run dotnet format
This commit is contained in:
parent
05989242f9
commit
ac2671452d
278 changed files with 1913 additions and 1808 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
|
@ -8,7 +8,7 @@ namespace Myriad.Gateway.State
|
|||
{
|
||||
private Task? _worker;
|
||||
private CancellationTokenSource? _workerCts;
|
||||
|
||||
|
||||
public TimeSpan? CurrentHeartbeatInterval { get; private set; }
|
||||
|
||||
public async ValueTask Start(TimeSpan heartbeatInterval, Func<Task> callback)
|
||||
|
|
@ -23,9 +23,9 @@ namespace Myriad.Gateway.State
|
|||
|
||||
public async ValueTask Stop()
|
||||
{
|
||||
if (_worker == null)
|
||||
if (_worker == null)
|
||||
return;
|
||||
|
||||
|
||||
_workerCts?.Cancel();
|
||||
try
|
||||
{
|
||||
|
|
@ -38,12 +38,12 @@ namespace Myriad.Gateway.State
|
|||
_worker = null;
|
||||
CurrentHeartbeatInterval = null;
|
||||
}
|
||||
|
||||
|
||||
private async Task Worker(TimeSpan heartbeatInterval, Func<Task> callback, CancellationToken ct)
|
||||
{
|
||||
var initialDelay = GetInitialHeartbeatDelay(heartbeatInterval);
|
||||
await Task.Delay(initialDelay, ct);
|
||||
|
||||
|
||||
while (!ct.IsCancellationRequested)
|
||||
{
|
||||
await callback();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue