From 15b47059428f61e8c29a724e5363cfb3572d92f3 Mon Sep 17 00:00:00 2001 From: Callum McIntyre Date: Mon, 24 Oct 2016 10:06:59 +0100 Subject: [PATCH] [CA-211267] Move the sleep time into a const int of the class. Also removed the ApplianceAction parameter from TickUntilCompletion (it behaved like a static method), to make it more similar to TaskPoller.PollToCompletion --- XenAdmin/Actions/OVFActions/ApplianceAction.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/XenAdmin/Actions/OVFActions/ApplianceAction.cs b/XenAdmin/Actions/OVFActions/ApplianceAction.cs index 98d9aa07e..3b4172822 100644 --- a/XenAdmin/Actions/OVFActions/ApplianceAction.cs +++ b/XenAdmin/Actions/OVFActions/ApplianceAction.cs @@ -46,6 +46,8 @@ namespace XenAdmin.Actions.OVFActions protected string m_tvmGateway; protected XenOvfTransportBase m_transportAction; + private const int SLEEP_TIME = 900; + /// /// RBAC dependencies needed to import appliance/export an appliance/import disk image. /// @@ -101,17 +103,15 @@ namespace XenAdmin.Actions.OVFActions protected void InitialiseTicker() { - System.Threading.Tasks.Task.Run(() => TickUntilCompletion(this)); + System.Threading.Tasks.Task.Run(() => TickUntilCompletion()); } - private void TickUntilCompletion(ApplianceAction action) + private void TickUntilCompletion() { - int sleepTime = 900; - - while (!action.IsCompleted) + while (!IsCompleted) { - action.OnChanged(); - Thread.Sleep(sleepTime); + OnChanged(); + Thread.Sleep(SLEEP_TIME); } }