You are here

public function RadioactivityRedisIncidentStorage::addIncident in Radioactivity 7.2

Add incident to cache

Overrides RadioactivityIncidentStorage::addIncident

File

includes/RadioactivityRedisIncidentStorage.inc, line 31
Memcached incident storage class

Class

RadioactivityRedisIncidentStorage
@file Memcached incident storage class

Code

public function addIncident(RadioactivityIncident $incident) {
  if (!($rc = $this
    ->connect())) {
    return;
  }
  $i = $rc
    ->get("radioactivity_top");
  if (!$i) {
    $i = 0;
  }
  $rc
    ->set("radioactivity_top", $i + 1);
  $rc
    ->set("radioactivity_incident_" . $i, serialize($incident));
}