Namespace process lock to allow running concurrent versions of the same command.
This commit is contained in:
@@ -33,10 +33,10 @@ return (function () {
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
$config['tmpDir'] = fixPath(env('WS_TMP_DIR', $config['path']));
|
$config['tmpDir'] = fixPath(env('WS_TMP_DIR', ag($config, 'path')));
|
||||||
|
|
||||||
$config['storage'] += [
|
$config['storage'] += [
|
||||||
'dsn' => 'sqlite:' . ag($config, 'path') . '/db/watchstate_' . $config['storage']['version'] . '.db',
|
'dsn' => 'sqlite:' . ag($config, 'path') . '/db/watchstate_' . ag($config, 'storage.version') . '.db',
|
||||||
'username' => null,
|
'username' => null,
|
||||||
'password' => null,
|
'password' => null,
|
||||||
'options' => [
|
'options' => [
|
||||||
@@ -67,7 +67,7 @@ return (function () {
|
|||||||
'default' => [
|
'default' => [
|
||||||
'options' => [
|
'options' => [
|
||||||
'headers' => [
|
'headers' => [
|
||||||
'User-Agent' => 'WatchState/' . ag($config, 'version'),
|
'User-Agent' => ag($config, 'name') . '/' . ag($config, 'version'),
|
||||||
],
|
],
|
||||||
'timeout' => 300.0,
|
'timeout' => 300.0,
|
||||||
'extra' => [
|
'extra' => [
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ class Command extends BaseCommand
|
|||||||
protected function single(\Closure $closure, OutputInterface $output): int
|
protected function single(\Closure $closure, OutputInterface $output): int
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if (!$this->lock($this->getName())) {
|
if (!$this->lock(getAppVersion() . ':' . $this->getName())) {
|
||||||
$output->writeln(
|
$output->writeln(
|
||||||
sprintf(
|
sprintf(
|
||||||
'<error>The command \'%s\' is already running in another process.</error>',
|
'<error>The command \'%s\' is already running in another process.</error>',
|
||||||
|
|||||||
Reference in New Issue
Block a user