Skip to content

Commit

Permalink
Remove temporary fix for services change with a proper fix for the re…
Browse files Browse the repository at this point in the history
…source paramters.
  • Loading branch information
boombatower committed May 2, 2012
1 parent c6ebbd7 commit dc1d6b6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 27 deletions.
20 changes: 0 additions & 20 deletions includes/api.inc
Expand Up @@ -16,11 +16,6 @@
* @see conduit_queue_claim()
*/
function conduit_api_claim($category) {
// Fix for services which passes all parameters as an associative array.
if (is_array($category)) {
extract($category);
}

conduit_include('queue');
if ($properties = conduit_queue_claim($category)) {
$item = $properties['item'];
Expand Down Expand Up @@ -53,11 +48,6 @@ function conduit_api_claim($category) {
* TRUE if successfull, otherwise FALSE.
*/
function conduit_api_result($item, $status, $result, $log, $duration) {
// Fix for services which passes all parameters as an associative array.
if (is_array($item)) {
extract($item);
}

$item = (object) $item;

// Acquire a lock to modify the node.
Expand Down Expand Up @@ -138,11 +128,6 @@ function conduit_api_result($item, $status, $result, $log, $duration) {
* TRUE if the job node was found and repeated, otherwise FALSE.
*/
function conduit_api_repeat($nid, $force = FALSE) {
// Fix for services which passes all parameters as an associative array.
if (is_array($nid)) {
extract($nid);
}

if (($node = node_load($nid)) && ($force || conduit_node_repeat_access($node))) {
$node->revision = TRUE;
node_save($node);
Expand All @@ -162,11 +147,6 @@ function conduit_api_repeat($nid, $force = FALSE) {
* @see lock_release()
*/
function conduit_api_lock_acquire($nid) {
// Fix for services which passes all parameters as an associative array.
if (is_array($nid)) {
extract($nid);
}

$lock = 'conduit_api_' . $nid;
while (!lock_acquire($lock)) {
sleep(1);
Expand Down
14 changes: 7 additions & 7 deletions includes/services.inc
Expand Up @@ -23,7 +23,7 @@ function conduit_services_resources() {
'name' => 'category',
'type' => 'string',
'description' => 'The job category from which to claim an item.',
'source' => 'data',
'source' => array('data' => 'category'),
'optional' => FALSE,
),
),
Expand All @@ -38,35 +38,35 @@ function conduit_services_resources() {
'name' => 'item',
'type' => 'array',
'description' => 'Queue item the results are related to.',
'source' => 'data',
'source' => array('data' => 'item'),
'optional' => FALSE,
),
array(
'name' => 'status',
'type' => 'int',
'description' => 'Chunk result status.',
'source' => 'data',
'source' => array('data' => 'status'),
'optional' => FALSE,
),
array(
'name' => 'result',
'type' => 'array',
'description' => 'The result of processing the chunk.',
'source' => 'data',
'source' => array('data' => 'result'),
'optional' => FALSE,
),
array(
'name' => 'log',
'type' => 'string',
'description' => 'The log generated while processing the chunk.',
'source' => 'data',
'source' => array('data' => 'log'),
'optional' => FALSE,
),
array(
'name' => 'duration',
'type' => 'int',
'description' => 'Indicates the the length of time elapsed processing the chunk.',
'source' => 'data',
'source' => array('data' => 'duration'),
'optional' => FALSE,
),
),
Expand All @@ -86,7 +86,7 @@ function conduit_services_resources() {
'name' => 'id',
'type' => 'int',
'description' => 'Job node ID to repeat.',
'source' => 'data',
'source' => array('data' => 'id'),
'optional' => FALSE,
),
),
Expand Down

0 comments on commit dc1d6b6

Please sign in to comment.