migrationRecordsPerMinute can randomly fail

Summary

migrationRecordsPerMinute is wrong type in the JSON parsing logic.

Steps to reproduce

  • Launch bot
  • Wait for migrations

What is the current bug behavior?

  • Exception is returned

What is the expected correct behavior?

  • Bot should parse JSON

Relevant logs and/or screenshots

Unhandled exception. System.Text.Json.JsonException: The JSON value could not be converted to System.Int32. Path: $.migrationRecordsPerMinute | LineNumber: 0 | BytePositionInLine: 227.
 ---> System.FormatException: Either the JSON value is not in a supported format, or is out of bounds for an Int32.
   at System.Text.Json.ThrowHelper.ThrowFormatException(NumericType numericType)
   at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader)
   at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   --- End of inner exception stack trace ---
   at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, Utf8JsonReader& reader, Exception ex)
   at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 json, JsonTypeInfo1 jsonTypeInfo)
   at ResoniteDiscordMetrics.Utils.ResoniteApiUtils.GenerateDataString(List1 sessions) in /builddir/ResoniteDiscordMetrics/Utils/ResoniteApiUtils.cs:line 54
   at ResoniteDiscordMetrics.Services.MessageService.UpdateValues() in /builddir/ResoniteDiscordMetrics/Services/MessageService.cs:line 108
   at ResoniteDiscordMetrics.Services.MessageService.DoWork(Object sender, DoWorkEventArgs doWorkEventArgs) in /builddir/ResoniteDiscordMetrics/Services/MessageService.cs:line 40
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()`

/cc @jae

Edited by Jae "J4" Salokettu