Skip to content

Commit

Permalink
Merge pull request #37 from gdubost/v2
Browse files Browse the repository at this point in the history
Changement de la gestion du vhost pour corriger des soucis de close de connexion
  • Loading branch information
Kumatetsu authored Dec 7, 2018
2 parents ae0aed8 + a571ec2 commit ebc3e2a
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/RabbitContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ public static function createVhosts()
foreach (self::$vhosts as $vhost) {
$vhost = str_replace('/', '%2f', $vhost);

try {
$client->delete("/api/vhosts/{$vhost}");
} catch (\Exception $e) {
// On ignore l'exception car le vhost n'existe peut être pas mais dans le doute on le supprime
}

$client->put("/api/vhosts/{$vhost}");
$client->put(
"/api/permissions/{$vhost}/guest",
Expand All @@ -60,19 +66,6 @@ public static function createVhosts()
}
}

/**
* @AfterSuite
*/
public static function deleteVhosts()
{
$client = self::getRabbitMqClient();

foreach (self::$vhosts as $vhost) {
$vhost = str_replace('/', '%2f', $vhost);
$client->delete("/api/vhosts/{$vhost}");
}
}

/**
* @Given /le producer "([^"]*)" devrait avoir publié un message dans la queue "([^"]*)"$/
*/
Expand Down

0 comments on commit ebc3e2a

Please sign in to comment.