Skip to content

Commit

Permalink
Merge pull request #40 from shopware/add-stop-messenger-cmd
Browse files Browse the repository at this point in the history
feat: add stopping of messenger workers on upgrade
  • Loading branch information
shyim authored Dec 18, 2024
2 parents c4c6744 + 595e5a5 commit 6a998af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/Services/UpgradeManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public function run(RunConfiguration $configuration, OutputInterface $output): v

$this->processHelper->console(['scheduled-task:register']);
$this->processHelper->console(['messenger:setup-transports']);
$this->processHelper->console(['messenger:stop-workers']);

$this->pluginHelper->installPlugins($configuration->skipAssetsInstall);
$this->pluginHelper->updatePlugins($configuration->skipAssetsInstall);
Expand Down
10 changes: 5 additions & 5 deletions tests/Services/UpgradeManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function testRunUpdatesVersionNoAssetCompile(): void

$manager->run(new RunConfiguration(true, true), $this->createMock(OutputInterface::class));

static::assertCount(4, $consoleCommands);
static::assertCount(5, $consoleCommands);
static::assertSame(['system:update:finish', '--skip-asset-build'], $consoleCommands[0]);
}

Expand Down Expand Up @@ -165,7 +165,7 @@ public function testRunWithDifferentSalesChannelUrl(): void

$manager->run(new RunConfiguration(), $this->createMock(OutputInterface::class));

static::assertCount(6, $consoleCommands);
static::assertCount(7, $consoleCommands);
static::assertSame(['sales-channel:create:storefront', '--name=Storefront', '--url=http://foo.com'], $consoleCommands[0]);
}

Expand Down Expand Up @@ -206,10 +206,10 @@ public function testRunWithMaintenanceMode(): void

$manager->run(new RunConfiguration(), $this->createMock(OutputInterface::class));

static::assertCount(6, $consoleCommands);
static::assertCount(7, $consoleCommands);
static::assertSame(['cache:pool:clear', 'cache.http', 'cache.object'], $consoleCommands[0]);
static::assertArrayHasKey(5, $consoleCommands);
static::assertSame(['cache:pool:clear', 'cache.http', 'cache.object'], $consoleCommands[5]);
static::assertArrayHasKey(6, $consoleCommands);
static::assertSame(['cache:pool:clear', 'cache.http', 'cache.object'], $consoleCommands[6]);
}

public function testRunWithLicenseDomain(): void
Expand Down

0 comments on commit 6a998af

Please sign in to comment.