Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error : Can not retrieve server list #2

Closed
Ciloe opened this issue Jul 12, 2021 · 2 comments
Closed

Error : Can not retrieve server list #2

Ciloe opened this issue Jul 12, 2021 · 2 comments

Comments

@Ciloe
Copy link

Ciloe commented Jul 12, 2021

Hi there, I have an error when using your code. When I launch my command, they are not problem. But sometimes, I have the title error : Can not retrieve server list. Do you know this error ?

My code :

        $io = new SymfonyStyle($input, $output);
        $io->title('Launch Command speedtest');

        $this->manager->beginTransaction();
        try {
            $speedtest = new Speedtest();
            $speedtest->getServers();
            $speedtest->getBestServer();
            $speedtest->download();
            $speedtest->upload();
            $results = $speedtest->results();

            $io->note('Speedtest finish');

            $logger = new Logger();
            $logger->setUpload($results->getUpload())
                ->setDownload($results->getDownload())
                ->setLatency($results->getLatency())
                ->setBytes(['receive' => $results->getBytesReceived(), 'sent' => $results->getBytesSent()])
                ->setLaunchedAt(new DateTimeImmutable())
            ;

            $this->manager->persist($logger);
            $this->manager->flush();

            $this->manager->commit();
            $io->success('Speedtest finish.');

            return Command::SUCCESS;
        } catch (Exception $e) {
            $this->manager->rollback();
            $this->logger->critical($e->getMessage(), ['commandLaunch']);
            $io->error(sprintf('Speedtest error : %s', $e->getMessage()));

            return Command::FAILURE;
        }
@Ciloe
Copy link
Author

Ciloe commented Aug 10, 2021

Any ideas ? It's appear every two times. I have a cron that launch the command every 15'' and it's failed every 30''. Thanks !

@aln-1
Copy link
Owner

aln-1 commented Mar 7, 2024

Hi, this sounds like communication error, but I can't be sure without more information

@aln-1 aln-1 closed this as completed Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants