You are here

function background_process_remove_process in Background Process 6

Same name and namespace in other branches
  1. 8 background_process.module \background_process_remove_process()
  2. 7 background_process.module \background_process_remove_process()

Remove a background process

Parameters

$handle: Handle of background process

Return value

mixed Number of handles deleted on success, FALSE on failure.

4 calls to background_process_remove_process()
BackgroundProcess::dispatch in ./BackgroundProcess.class.php
background_process_service_execute in ./background_process.module
Execute the service
background_process_unlock in ./background_process.module
Unlock background process.
_background_process_cleanup_locks in ./background_process.module
Shutdown handler for removing locks
1 string reference to 'background_process_remove_process'
background_process_service_execute in ./background_process.module
Execute the service

File

./background_process.module, line 766

Code

function background_process_remove_process($handle, $start = NULL) {
  if (isset($start)) {
    $result = db_query("DELETE FROM {background_process} WHERE handle = '%s' AND start_stamp LIKE '%s'", $handle, sprintf("%.06f", $start));
  }
  else {
    $result = db_query("DELETE FROM {background_process} WHERE handle = '%s'", $handle);
  }
  if ($result) {
    $result = db_affected_rows();
  }
  return $result;
}