Skip to content

Commit 1251138

Browse files
author
Andy Borek
committed
Merge pull request #22 from Longcat00/master
Fixed the work_running function to search by bucket.
2 parents 0375aae + 068f192 commit 1251138

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

fork_daemon.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ public function addwork(array $new_work_units, $identifier = '', $bucket = self:
970970
return;
971971
}
972972

973-
/*
973+
/**
974974
* Based on identifier and bucket is a child working on the work
975975
*
976976
* @param string unique identifier for the work
@@ -990,7 +990,7 @@ public function is_work_running($identifier, $bucket = self::DEFAULT_BUCKET)
990990
return false;
991991
}
992992

993-
/*
993+
/**
994994
* Return array of currently running children
995995
*
996996
* @param int $bucket the bucket
@@ -1001,9 +1001,12 @@ public function work_running($bucket = self::DEFAULT_BUCKET)
10011001
$results = array();
10021002
foreach ($this->forked_children as $pid => $child)
10031003
{
1004-
if ($child['status'] != self::STOPPED)
1004+
if ($child['status'] != self::STOPPED && $child['bucket'] === $bucket)
1005+
{
10051006
$results[$pid] = $child;
1007+
}
10061008
}
1009+
10071010
return $results;
10081011
}
10091012

0 commit comments

Comments
 (0)