You are here

public function UltimateCronCacheLogEntry::save in Ultimate Cron 7.2

Save log entry.

Overrides UltimateCronLogEntry::save

File

plugins/ultimate_cron/logger/cache.class.php, line 90
Cache logger for Ultimate Cron.

Class

UltimateCronCacheLogEntry
Class for using cache as storage for log entries.

Code

public function save() {
  if (!$this->lid) {
    return;
  }
  if ($this->log_type != ULTIMATE_CRON_LOG_TYPE_NORMAL) {
    return;
  }
  $job = _ultimate_cron_job_load($this->name);
  $settings = $job
    ->getSettings('logger');
  $expire = $settings['timeout'] > 0 ? time() + $settings['timeout'] : $settings['timeout'];
  cache_set('uc-name:' . $this->name, $this->lid, $settings['bin'], $expire);
  cache_set('uc-lid:' . $this->lid, $this
    ->getData(), $settings['bin'], $expire);
}