1
0
mirror of https://github.com/r4sas/recastin-panel synced 2025-03-12 13:21:14 +00:00

Added support for custom nginx reload command

This commit is contained in:
Shyim 2018-04-25 17:55:06 +02:00
parent 91c17420b3
commit ced1d1dc37
2 changed files with 7 additions and 2 deletions

View File

@ -4,6 +4,7 @@ parameters:
locale: 'en' locale: 'en'
appHost: '%env(APP_HOST)%' appHost: '%env(APP_HOST)%'
nginxFolder: '%env(NGINX_CONFIG_DIR)%' nginxFolder: '%env(NGINX_CONFIG_DIR)%'
nginxRestartCommand: '%env(NGINX_RESTART_COMMAND)%'
services: services:
# default configuration for services in *this* file # default configuration for services in *this* file

View File

@ -8,13 +8,17 @@ use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle; use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
/** /**
* Class CronRunnerCommand * Class CronRunnerCommand
* @author Soner Sayakci <shyim@posteo.de> * @author Soner Sayakci <shyim@posteo.de>
*/ */
class CronRunnerCommand extends Command class CronRunnerCommand extends Command implements ContainerAwareInterface
{ {
use ContainerAwareTrait;
/** /**
* @var Connection * @var Connection
*/ */
@ -59,7 +63,7 @@ class CronRunnerCommand extends Command
{ {
if ($this->connection->fetchColumn('SELECT 1 FROM queue')) { if ($this->connection->fetchColumn('SELECT 1 FROM queue')) {
$this->configGenerator->generate(); $this->configGenerator->generate();
system('systemctl reload nginx-rtmp'); system($this->container->getParameter('nginxRestartCommand'));
$io = new SymfonyStyle($input, $output); $io = new SymfonyStyle($input, $output);
$io->success('Configs generated, rtmp has been reloaded'); $io->success('Configs generated, rtmp has been reloaded');