While Making 2 of the same request to the same url i the System.IO.IOException: 'Sharing violation on path /data/user/0/com.companyname.chaycesanime/cache/com.companyname.chaycesanime/MonkeyCache/Barrel.db' exception.
public static async Task<T> GetAsync<T>(string url, int days = 1, bool forceRefresh = false)
{
var json = string.Empty;
if (Connectivity.NetworkAccess != NetworkAccess.Internet)
json = Barrel.Current.Get<string>(url);
if (!forceRefresh && !Barrel.Current.IsExpired(url))
json = Barrel.Current.Get<string>(url);
try
{
if (string.IsNullOrWhiteSpace(json))
{
json = await client.GetStringAsync(url);
Barrel.Current.Add(url, json, TimeSpan.FromDays(days));
}
return JsonConvert.DeserializeObject<T>(json);
}
catch (Exception ex)
{
Console.WriteLine($"Unable to get information from server {ex}");
//probably re-throw here :)
}
return default(T);
}
While Making 2 of the same request to the same url i the System.IO.IOException: 'Sharing violation on path /data/user/0/com.companyname.chaycesanime/cache/com.companyname.chaycesanime/MonkeyCache/Barrel.db' exception.