Browse Source

fix: don't raise REST log events twice

The DiscordSocketClient and DiscordSocketRestClient share the same
backing API client, so the Log events on both clients will be raised
from the same API calls. Proxying log events from the
DiscordSocketRestClient then means that the Log event the user hooks
into will be raised twice for a single log message.

Thanks to @TheCasino for noticing this.
tags/2.1.1
Christopher Felegy 6 years ago
parent
commit
c78a6790b1
1 changed files with 0 additions and 4 deletions
  1. +0
    -4
      src/Discord.Net.WebSocket/DiscordSocketClient.cs

+ 0
- 4
src/Discord.Net.WebSocket/DiscordSocketClient.cs View File

@@ -132,10 +132,6 @@ namespace Discord.WebSocket
ExclusiveBulkDelete = config.ExclusiveBulkDelete; ExclusiveBulkDelete = config.ExclusiveBulkDelete;
State = new ClientState(0, 0); State = new ClientState(0, 0);
Rest = new DiscordSocketRestClient(config, ApiClient); Rest = new DiscordSocketRestClient(config, ApiClient);
Rest.Log += (log) =>
{
return _restLogger.LogAsync(log.Severity, log.Message, log.Exception);
};
_heartbeatTimes = new ConcurrentQueue<long>(); _heartbeatTimes = new ConcurrentQueue<long>();


_stateLock = new SemaphoreSlim(1, 1); _stateLock = new SemaphoreSlim(1, 1);


Loading…
Cancel
Save