Namespace process lock to allow running concurrent versions of the same command.

This commit is contained in:
Abdulmhsen B. A. A
2022-05-29 09:24:17 +03:00
parent 11116676f0
commit 436cc10f52
2 changed files with 4 additions and 4 deletions

View File

@@ -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' => [

View File

@@ -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>',