Resolved blocked service UI bug (#134)
This commit is contained in:
@@ -36,7 +36,7 @@ namespace gaseous_server
|
|||||||
List<ProcessQueue.QueueItem> ActiveList = new List<ProcessQueue.QueueItem>();
|
List<ProcessQueue.QueueItem> ActiveList = new List<ProcessQueue.QueueItem>();
|
||||||
ActiveList.AddRange(ProcessQueue.QueueItems);
|
ActiveList.AddRange(ProcessQueue.QueueItems);
|
||||||
foreach (ProcessQueue.QueueItem qi in ActiveList) {
|
foreach (ProcessQueue.QueueItem qi in ActiveList) {
|
||||||
if (CheckProcessBlockList(qi) == true) {
|
if (CheckIfProcessIsBlockedByOthers(qi) == false) {
|
||||||
qi.BlockedState(false);
|
qi.BlockedState(false);
|
||||||
if (DateTime.UtcNow > qi.NextRunTime || qi.Force == true)
|
if (DateTime.UtcNow > qi.NextRunTime || qi.Force == true)
|
||||||
{
|
{
|
||||||
@@ -69,30 +69,24 @@ namespace gaseous_server
|
|||||||
_timer?.Dispose();
|
_timer?.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool CheckProcessBlockList(ProcessQueue.QueueItem queueItem)
|
private bool CheckIfProcessIsBlockedByOthers(ProcessQueue.QueueItem queueItem)
|
||||||
{
|
|
||||||
if (queueItem.Blocks.Count > 0)
|
|
||||||
{
|
{
|
||||||
foreach (ProcessQueue.QueueItem qi in ProcessQueue.QueueItems)
|
foreach (ProcessQueue.QueueItem qi in ProcessQueue.QueueItems)
|
||||||
{
|
{
|
||||||
|
if (qi.ItemState == ProcessQueue.QueueItemState.Running) {
|
||||||
|
// other service is running, check if queueItem is blocked by it
|
||||||
if (
|
if (
|
||||||
(
|
qi.Blocks.Contains(queueItem.ItemType) ||
|
||||||
queueItem.Blocks.Contains(qi.ItemType) ||
|
qi.Blocks.Contains(ProcessQueue.QueueItemType.All)
|
||||||
queueItem.Blocks.Contains(ProcessQueue.QueueItemType.All)
|
|
||||||
) &&
|
|
||||||
qi.ItemState == ProcessQueue.QueueItemState.Running
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return false;
|
Console.WriteLine(queueItem.ItemType.ToString() + " is blocked by " + qi.ItemType.ToString());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return false;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
var itemStateName;
|
var itemStateName;
|
||||||
var itemLastStart;
|
var itemLastStart;
|
||||||
if (result[i].IsBlocked == false) {
|
if (result[i].isBlocked == false) {
|
||||||
switch (result[i].itemState) {
|
switch (result[i].itemState) {
|
||||||
case 'NeverStarted':
|
case 'NeverStarted':
|
||||||
itemStateName = "Never started";
|
itemStateName = "Never started";
|
||||||
|
Reference in New Issue
Block a user