mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2025-01-20 07:19:18 +01:00
[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
This commit is contained in:
parent
de43761039
commit
15b4705942
@ -46,6 +46,8 @@ namespace XenAdmin.Actions.OVFActions
|
||||
protected string m_tvmGateway;
|
||||
protected XenOvfTransportBase m_transportAction;
|
||||
|
||||
private const int SLEEP_TIME = 900;
|
||||
|
||||
/// <summary>
|
||||
/// RBAC dependencies needed to import appliance/export an appliance/import disk image.
|
||||
/// </summary>
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user