public function checkAvailability(GetResponseEvent $event)
    {
        if ('prod' === $this->kernel->getEnvironment() && $event->isMasterRequest()) {
            $isAdmin = false;

            $token = $this->tokenStorage->getToken();
            if ($token) {
                foreach ($token->getRoles() as $role) {
                    if ('ROLE_ADMIN' === $role->getRole()) {
                        $isAdmin = true;
                        break;
                    }
                }
            }

            $now = time();
            if (is_int($this->config->getParameter('platform_init_date'))) {
                $minDate = new \DateTime();
                $minDate->setTimestamp($this->config->getParameter('platform_init_date'));
            } else {
                $minDate = new \DateTime($this->config->getParameter('platform_init_date'));
            }

            if (is_int($this->config->getParameter('platform_limit_date'))) {
                $minDate = new \DateTime();
                $minDate->setTimestamp($this->config->getParameter('platform_limit_date'));
            } else {
                $expirationDate = new \DateTime($this->config->getParameter('platform_limit_date'));
            }

            if (!$isAdmin &&
                !in_array($event->getRequest()->get('_route'), static::PUBLIC_ROUTES) &&
                ($minDate->getTimeStamp() > $now || $now > $expirationDate->getTimeStamp())
            ) {
                throw new HttpException(503, 'Platform is not available.');
            }
        }
    }