Updated Session extensions and Route Contoller

Increased the number of Poll requests and disabled an irrelevant error stating that there was a cyclical struture (Just a Doubly Linked List)
This commit is contained in:
Luke Else 2022-01-27 09:46:38 +00:00
parent 924e25e1c6
commit 3cb2b9c9b5
3 changed files with 7 additions and 3 deletions

View File

@ -127,7 +127,7 @@ namespace EFB.Controllers
Dictionary<string, string> headerData = new Dictionary<string, string>();
headerData.Add("Authorization", $"Bearer {user.UserToken.TokenValue}");
while (collected == false && pollCount < 3)
while (collected == false && pollCount < 15)
{
//Make Polling Request
var pollingRequest = API.Put<List<PollResponse>>($"https://api.autorouter.aero/v1.0/router/{user.RouteToken.TokenValue}/longpoll", headerData, null);

View File

@ -88,7 +88,7 @@ namespace EFB.Models
route.Current.Next = route.Arrival;
route.Arrival.Previous = route.Current;
route.Current = null;
route.Current = route.Departure;
return route;
}

View File

@ -7,7 +7,11 @@ namespace EFB.Sessions
{
public static void SetObject(this ISession session, string key, object value)
{//Sets the object of a session to Object
session.SetString(key, JsonConvert.SerializeObject(value));
session.SetString(key, JsonConvert.SerializeObject(value, Formatting.None,
new JsonSerializerSettings(){
ReferenceLoopHandling = ReferenceLoopHandling.Ignore
}
));
}
public static T GetObject<T>(this ISession session, string key)