Exit 1 on failure for LS CLI.
This commit is contained in:
parent
2d43f44e6a
commit
3db6903185
|
@ -73,7 +73,11 @@ class LiquidsoapCommand extends CommandAbstract
|
|||
/** @var AbstractCommand $commandObj */
|
||||
$commandObj = $this->di->get($command->getClass());
|
||||
|
||||
$io->writeln($commandObj->run($station, $asAutoDj, $payload));
|
||||
return 0;
|
||||
$result = $commandObj->run($station, $asAutoDj, $payload);
|
||||
$io->writeln($result);
|
||||
|
||||
return ('' === $result || 'false' === $result)
|
||||
? 1
|
||||
: 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -206,22 +206,17 @@ class ConfigWriter implements EventSubscriberInterface
|
|||
def azuracast_api_call(~timeout=2, url, payload) =
|
||||
command = "liquidsoap_cli --as-autodj #{url} ${stationId}"
|
||||
|
||||
try
|
||||
response = list.hd(
|
||||
process.read.lines(
|
||||
env=[("PAYLOAD", payload)],
|
||||
timeout=float_of_int(timeout),
|
||||
command
|
||||
),
|
||||
default=""
|
||||
)
|
||||
|
||||
log("API #{url} - Response: #{response}")
|
||||
response
|
||||
catch err do
|
||||
log("API #{url} - Error: #{error.kind(err)} - #{error.message(err)}")
|
||||
"false"
|
||||
end
|
||||
response = list.hd(
|
||||
process.read.lines(
|
||||
env=[("PAYLOAD", payload)],
|
||||
timeout=float_of_int(timeout),
|
||||
command
|
||||
),
|
||||
default=""
|
||||
)
|
||||
|
||||
log("API #{url} - Response: #{response}")
|
||||
"#{response}"
|
||||
end
|
||||
EOF
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue