public function store($user, Request $request) { $meta = $this->prepareMeta($request); // No need to store the full Carbon object $meta['date'] = $meta['date']->toDateTimeString(); $this->storage->set('usr.' . $user->getKey() . '.lastSeen', json_encode($meta, JSON_FORCE_OBJECT)); }
/** * Execute the console command. * * @return void */ public function fire() { $this->infoStart('Getting official skin list...'); $skins = $this->getOfficialSkinList(); $this->infoFinish('Getting official skin done'); $this->infoStart('Resolving skin ids to items...'); $skins = $this->resolveSkinsToItems($skins); $this->infoFinish('Resolving skin ids to items done'); Redis::set(self::$key, serialize($skins)); }
/** * Execute the console command. * * @return void */ public function fire() { $this->infoStart('Parsing EU leaderboard...'); $eu_rankings = $this->parseLeaderboard('eu'); $this->infoFinish('Done parsing!'); $this->infoStart('Parsing NA leaderboard...'); $na_rankings = $this->parseLeaderboard('na'); $this->infoFinish('Done parsing!'); Redis::set(self::$key, serialize(['eu' => $eu_rankings, 'na' => $na_rankings])); // Trigger an event for post-processor to hook into Event::fire(new PvpLeaderboardUpdated()); }
/** * Update timestamp. * * @param string $cached_at * @return bool */ public function update($cached_at) { return Timestamp::set('registry_updated_at', $cached_at); }
/** * @return mixed */ public function destroy() { // Disable access if (Auth::user()->isLaunchController()) { Auth::user()->launch_controller_flag = false; Auth::user()->save(); } // Turn off SpaceXStats Live Redis::set('live:active', false); // Clean up all spacexstats live redis keys Redis::del(['live:streams', 'live:title', 'live:description', 'live:resources', 'live:sections', 'live:updates', 'live:countdown', 'live:discussion', 'live:isForLaunch', 'live:cannedResponses', 'live:reddit', 'live:status']); // Send out event event(new LiveEndedEvent()); return response()->json(null, 204); }
public static function setConnection($conn) { Redis::set('mysql_current_connection', $conn); }
public function redisPut() { Redis::set('name', 'I am wangguoying'); }
public function provision(Request $request, $id, $uuid) { $provision = \App\Provision::where('id', $id)->where('uuid', $uuid)->first(); if ($provision === null) { $request->session()->flash(str_random(4), ['type' => 'danger', 'message' => 'Could not find id/uuid combo']); return redirect('/?ohno'); } $redisKey = config('rediskeys.digitalocean_token') . $uuid; Redis::set($redisKey, $request->session()->get('digitalocean')['token']); // This expire is a backup in case the provision job fails, and doesn't delete the key explicitly at the end Redis::expire($redisKey, 60 * 60); // 60 minutes - if a provision job takes longer than this we won't be able to delete our SSH keys from the users DO account $provision->inputs = $request->session()->get("inputs.{$uuid}"); // It doesn't accept SSH connections immediately after creation, so we delay $job = (new \App\Jobs\Provision($provision))->delay(5); $this->dispatch($job); return redirect(url('/provision/provisioning/' . $provision->id . '/' . $provision->uuid)); }
private static function requestCache() { $ads = self::where(['is_active' => 1])->select('copy', 'url_shorten as url')->orderBy('created_at', 'desc')->get()->toArray(); $cache_key = self::getCacheKey(); if (!empty($ads)) { Redis::set($cache_key, serialize($ads)); } else { Redis::del($cache_key); } }