You are here

function progress_initialize_progress in Background Process 8

Initialize a progress.

1 call to progress_initialize_progress()
background_process_service_execute in ./background_process.module
Implements to Execute the service.

File

progress/progress.module, line 17
Progress framework for keeping track of progresses. @todo Force MyISAM for table {progress} to avoid transaction/isolation level problems, and use INSERT DELAYED for performance.

Code

function progress_initialize_progress($name, $message) {
  progress_remove_progress($name);
  $current = microtime(TRUE);
  return db_insert('progress')
    ->fields([
    'name' => $name,
    'progress' => 0,
    'message' => $message,
    'start_stamp' => $current,
    'current_stamp' => $current,
  ])
    ->execute();
}