Skip to content

Commit

Permalink
Исправляет предупреждения
Browse files Browse the repository at this point in the history
  • Loading branch information
inyutin-maxim committed Sep 11, 2023
1 parent 62e71c0 commit 9cda8b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VkNet/Categories/MessagesCategory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ public GetIntentUsersResult GetIntentUsers(MessagesGetIntentUsersParams getInten
});

/// <inheritdoc />
[Obsolete(ObsoleteText.MessageDeleteDialog)]
[Obsolete(ObsoleteText.MessageDeleteDialog, true)]
public ulong DeleteDialog(long? userId, long? peerId = null, uint? offset = null, uint? count = null) =>
DeleteConversation(userId, peerId);

Expand Down
7 changes: 4 additions & 3 deletions VkNet/Utils/CountByIntervalAwaitableConstraint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,18 @@ public async Task<IDisposable> WaitForReadinessAsync(CancellationToken cancellat
await _semaphore.WaitAsync(cancellationToken)
.ConfigureAwait(false);

if (DateTime.Now - _dateTime >= _timeSpan)
if (DateTime.UtcNow - _dateTime >= _timeSpan)
{
_left = _count;
_dateTime = DateTime.Now;
_dateTime = DateTime.UtcNow;
}

if (_left > 0)
{
_left--;
} else
{
var timeToWait = (int) Math.Ceiling((_timeSpan - (DateTime.Now - _dateTime)).TotalMilliseconds + 15);
var timeToWait = (int) Math.Ceiling((_timeSpan - (DateTime.UtcNow - _dateTime)).TotalMilliseconds + 15);

try
{
Expand All @@ -88,6 +88,7 @@ await Task.Delay(timeToWait, cancellationToken)
}
catch
{
// ignored
}

_left = _count - 1;
Expand Down

0 comments on commit 9cda8b2

Please sign in to comment.