Jake Vanderwerf
2026-08-26 d8cc8f9eedcb21c4ba5ac4d91852591fbb179d92
inc/managers/Referrals.php
@@ -63,14 +63,9 @@
      $this->role = Site::getReferralRole();
      $this->default_settings['referral_role'] = $this->role;
      $this->cache = Cache::for('referrals', WEEK_IN_SECONDS);
//    $this->requestCache = Cache::for('referral_requests', WEEK_IN_SECONDS)->connect('referrals', true);
      $this->statsCache = Cache::for('referral_stats', WEEK_IN_SECONDS)->connect('referrals', true)->user();
      if (JVB_TESTING) {
         $this->cache->flush();
//       $this->requestCache->flush();
         $this->statsCache->flush();
      }
      $this->cache = Cache::for('referrals');
      $this->statsCache = Cache::for('referral_stats', null, WEEK_IN_SECONDS)->user();
      $this->referralPage = $this->getReferralPageId();
      $this->settings = $this->getRewardSettings();
@@ -852,7 +847,7 @@
   public function getTopReferrers(int $limit = 10, string $period = 'all'): array
   {
      return $this->statsCache->remember(
         $this->statsCache->generateKey(['per_page' => $limit, 'period' => $period]),
         ['per_page' => $limit, 'period' => $period],
         function() use ($limit, $period) {
            $where = '';
            if ($period !== 'all') {
@@ -1005,7 +1000,7 @@
    */
   protected function generateCSV(array $referrals): string
   {
      $cache = Cache::for('referralCSV', HOUR_IN_SECONDS)->connect('referrals');
      $cache = Cache::for('referralCSV', null, HOUR_IN_SECONDS);
      return $cache->remember(
         'csv',
         function () use ($referrals) {