You are here

public function UltimateCronProgressMemcache::setProgress in Ultimate Cron 7.2

Set job progress.

Parameters

float $progress: The progress (0 - 1).

File

./ultimate_cron.memcache-progress.inc, line 90
Pseudo namespace for progress functions.

Class

UltimateCronProgressMemcache
Class for using memcache as storage for progress.

Code

public function setProgress($progress) {
  if (microtime(TRUE) >= $this->progressUpdated + $this->interval) {
    $name = 'uc-progress:' . $this->name;
    $bin = variable_get('ultimate_cron_progress_memcache_bin', 'progress');
    dmemcache_set($name, $progress, 0, $bin);
    $this->progressUpdated = microtime(TRUE);
    return TRUE;
  }
  return FALSE;
}