From dddc1ac7f9da63464eb8ed3893b470c95a3a2ce6 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 30 Aug 2021 22:42:24 +0000 Subject: [PATCH] --- .../Plugins/AyaNova.Plugin.V8/Opt.Designer.cs | 44 +++++++++++++++++++ source/Plugins/AyaNova.Plugin.V8/Opt.cs | 1 + source/Plugins/AyaNova.Plugin.V8/V8.cs | 3 ++ source/Plugins/AyaNova.Plugin.V8/util.cs | 4 +- 4 files changed, 50 insertions(+), 2 deletions(-) diff --git a/source/Plugins/AyaNova.Plugin.V8/Opt.Designer.cs b/source/Plugins/AyaNova.Plugin.V8/Opt.Designer.cs index 7c3d0e6..e079426 100644 --- a/source/Plugins/AyaNova.Plugin.V8/Opt.Designer.cs +++ b/source/Plugins/AyaNova.Plugin.V8/Opt.Designer.cs @@ -36,6 +36,9 @@ this.label2 = new System.Windows.Forms.Label(); this.edTags = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.nTimeOut = new System.Windows.Forms.NumericUpDown(); + ((System.ComponentModel.ISupportInitialize)(this.nTimeOut)).BeginInit(); this.SuspendLayout(); // // btnCancel @@ -116,6 +119,42 @@ this.label1.TabIndex = 41; this.label1.Text = "Tag all exported objects"; // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(26, 195); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(165, 13); + this.label3.TabIndex = 43; + this.label3.Text = "Override HTTP timeout (seconds)"; + // + // nTimeOut + // + this.nTimeOut.Increment = new decimal(new int[] { + 60, + 0, + 0, + 0}); + this.nTimeOut.Location = new System.Drawing.Point(29, 211); + this.nTimeOut.Maximum = new decimal(new int[] { + 3600, + 0, + 0, + 0}); + this.nTimeOut.Minimum = new decimal(new int[] { + 30, + 0, + 0, + 0}); + this.nTimeOut.Name = "nTimeOut"; + this.nTimeOut.Size = new System.Drawing.Size(120, 20); + this.nTimeOut.TabIndex = 44; + this.nTimeOut.Value = new decimal(new int[] { + 100, + 0, + 0, + 0}); + // // Opt // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -123,6 +162,8 @@ this.AutoSize = true; this.ClientSize = new System.Drawing.Size(614, 353); this.ControlBox = false; + this.Controls.Add(this.nTimeOut); + this.Controls.Add(this.label3); this.Controls.Add(this.label1); this.Controls.Add(this.edTags); this.Controls.Add(this.label2); @@ -135,6 +176,7 @@ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Export options"; this.Load += new System.EventHandler(this.Opt_Load); + ((System.ComponentModel.ISupportInitialize)(this.nTimeOut)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -149,5 +191,7 @@ private System.Windows.Forms.Label label2; private System.Windows.Forms.TextBox edTags; private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.NumericUpDown nTimeOut; } } \ No newline at end of file diff --git a/source/Plugins/AyaNova.Plugin.V8/Opt.cs b/source/Plugins/AyaNova.Plugin.V8/Opt.cs index b50760d..3760645 100644 --- a/source/Plugins/AyaNova.Plugin.V8/Opt.cs +++ b/source/Plugins/AyaNova.Plugin.V8/Opt.cs @@ -13,6 +13,7 @@ namespace AyaNova.PlugIn.V8 { public bool ExportAssignedDocs { get { return ckExportAssignedDocs.Checked; } } public string Tags { get { return edTags.Text; } } + public int HTTPTimeOut { get { return (int)nTimeOut.Value; } } public Opt() { diff --git a/source/Plugins/AyaNova.Plugin.V8/V8.cs b/source/Plugins/AyaNova.Plugin.V8/V8.cs index b4fe536..14b3a7a 100644 --- a/source/Plugins/AyaNova.Plugin.V8/V8.cs +++ b/source/Plugins/AyaNova.Plugin.V8/V8.cs @@ -159,6 +159,9 @@ namespace AyaNova.PlugIn.V8 } ExportAssignedDocs = dOpt.ExportAssignedDocs; ImportTag = util.NormalizeTag(dOpt.Tags); + util.HTTPCLIENT_TIMEOUT_SECONDS = dOpt.HTTPTimeOut; + util.InitClient(); + //here because we logged in fine and can proceed //MessageBox.Show("Login successful! JWT is " + util.JWT); diff --git a/source/Plugins/AyaNova.Plugin.V8/util.cs b/source/Plugins/AyaNova.Plugin.V8/util.cs index cff8be9..a54d55f 100644 --- a/source/Plugins/AyaNova.Plugin.V8/util.cs +++ b/source/Plugins/AyaNova.Plugin.V8/util.cs @@ -23,7 +23,7 @@ namespace AyaNova.PlugIn.V8 public const string API_BASE_ROUTE = "api/v8/"; private const int MAX_TRIES = 3;//max times to retry an api call before giving up private const int API_RETRY_DELAY = 3000;//pause in ms before retrying api call - private const int HTTPCLIENT_TIMEOUT_SECONDS = 1200;//default for all ops, normally 100seconds but would kill large file uploads + public static int HTTPCLIENT_TIMEOUT_SECONDS = 30;//default for all ops, normally 100seconds but would kill large file uploads public static HttpClient client = null; //url once known to be good internal static string ApiBaseUrl { get; set; } @@ -40,7 +40,7 @@ namespace AyaNova.PlugIn.V8 #region INIT / AUTH - private static void InitClient() + public static void InitClient() { if (client != null) {