Closed micah686 closed 7 years ago
Can you provide the full json response given when a Throttle Error is returned from the API?
I've never actually tried to be throttled to test that part of the code, so it has been conceptual the entire time.
Here you go: Get Response | error {"msg":"Throttle limit reached.","fullwait":603.4,"minwait":3.4,"type":"cmd","id":"throttled"} {"msg":"Throttle limit reached.","fullwait":603.4,"minwait":3.4,"type":"cmd","id":"throttled"}
Can you try that change?
That seemed to fix it.
After getting a throttled cmd error, VndbSharp attempts to run the DurationToDateTimeOffsetConverter ReadJson() method. However, when it tries to run return new
DateTimeOffset(DateTime.Now).ToOffset(TimeSpan.FromSeconds(seconds));
, it gives aSystem.ArgumentException: 'Offset must be specified in whole minutes.'
.I've had the seconds equal from 3.2 up to 608.5, but it always seems to trigger that error.
On a somewhat related note: In
ReadJson(...., Object existingValue,...)
, the existingValue always seems to be{1/1/0001 12:00:00 AM +00:00}
, instead of the current DateTime. I'm not sure if that is relevant or not.Perhaps using TimeSpan instead of DateTimeOffset would solve the issue? It seems like DateTimeOffset isn't really meant for precise offsets in seconds.