/** * Garbage collect activations and reminders. * * @param SecurityApi $security * @param SecurityContextConfiguration $configuration */ protected function garbageCollect(SecurityApi $security, SecurityContextConfiguration $configuration) { try { $activations = $security->activations(); $reminders = $security->reminders(); $this->sweep($activations, $configuration->getActivationsLottery()); $this->sweep($reminders, $configuration->getRemindersLottery()); } catch (\Exception $e) { // Silently fail and report, but still serve the content. $this->logger->error("Unable to garbage collect reminders or activations: " . $e->getMessage(), $e->getTrace()); } }