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'] += [
|
||||
'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,
|
||||
'password' => null,
|
||||
'options' => [
|
||||
@@ -67,7 +67,7 @@ return (function () {
|
||||
'default' => [
|
||||
'options' => [
|
||||
'headers' => [
|
||||
'User-Agent' => 'WatchState/' . ag($config, 'version'),
|
||||
'User-Agent' => ag($config, 'name') . '/' . ag($config, 'version'),
|
||||
],
|
||||
'timeout' => 300.0,
|
||||
'extra' => [
|
||||
|
||||
@@ -76,7 +76,7 @@ class Command extends BaseCommand
|
||||
protected function single(\Closure $closure, OutputInterface $output): int
|
||||
{
|
||||
try {
|
||||
if (!$this->lock($this->getName())) {
|
||||
if (!$this->lock(getAppVersion() . ':' . $this->getName())) {
|
||||
$output->writeln(
|
||||
sprintf(
|
||||
'<error>The command \'%s\' is already running in another process.</error>',
|
||||
|
||||
Reference in New Issue
Block a user