diff --git a/source/Plugins/AyaNova.Plugin.V8/V8.cs b/source/Plugins/AyaNova.Plugin.V8/V8.cs
index b2bc97d..0655221 100644
--- a/source/Plugins/AyaNova.Plugin.V8/V8.cs
+++ b/source/Plugins/AyaNova.Plugin.V8/V8.cs
@@ -139,7 +139,7 @@ namespace AyaNova.PlugIn.V8
}
//#endif
-
+ util.Initialized = false;
Auth d = new Auth();
var res = d.ShowDialog(); ;
if (res == DialogResult.Cancel)
diff --git a/source/Plugins/AyaNova.Plugin.V8/util.cs b/source/Plugins/AyaNova.Plugin.V8/util.cs
index 61674b8..8aecde8 100644
--- a/source/Plugins/AyaNova.Plugin.V8/util.cs
+++ b/source/Plugins/AyaNova.Plugin.V8/util.cs
@@ -21,7 +21,7 @@ namespace AyaNova.PlugIn.V8
public static GZTW.AyaNova.BLL.LocalizedTextTable LocaleText = null;
const string TEST_ROUTE = "notify/hello";
const string API_BASE_ROUTE = "api/v8/";
- static HttpClient client = new HttpClient();
+ public static HttpClient client = null;
//url once known to be good
internal static string ApiBaseUrl { get; set; }
internal static string JWT { get; set; }
@@ -40,6 +40,10 @@ namespace AyaNova.PlugIn.V8
private static void InitClient()
{
if (Initialized) return;
+ if (client != null)
+ client.Dispose();
+ client = null;
+ client = new HttpClient();
client.BaseAddress = new Uri(ApiBaseUrl);
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
@@ -63,22 +67,27 @@ namespace AyaNova.PlugIn.V8
}
if (!serverUrl.StartsWith("http")) serverUrl = "http://" + serverUrl;
+ ApiBaseUrl = serverUrl;
+ InitClient();
//try to connect, ping the server api
- if (!Initialized)
- {
- client.BaseAddress = new Uri(serverUrl);
- client.DefaultRequestHeaders.Accept.Clear();
- client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
- Initialized = true;
- }
+ //if (!Initialized)
+ //{
+ // client.BaseAddress = new Uri(serverUrl);
+ // client.DefaultRequestHeaders.Accept.Clear();
+ // client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
+ // Initialized = true;
+ //}
try
{
+ // TimeSpan tsDefault = client.Timeout;
+ // client.Timeout = new TimeSpan(0, 0, 20);
HttpResponseMessage response = await client.GetAsync(serverUrl + TEST_ROUTE);
+ // client.Timeout = tsDefault;
if (response.IsSuccessStatusCode)
{
- ApiBaseUrl = serverUrl;
+
return "OK";
}
else
@@ -775,7 +784,7 @@ Locale Français is customized [signature: 804154061] exporting
//
//
//https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths
-
+
System.Text.StringBuilder sb = new System.Text.StringBuilder();
//open