Skip to content

Commit

Permalink
Do not unset DynamoDB Client on disconnect until implement reconnect …
Browse files Browse the repository at this point in the history
…method.
  • Loading branch information
kitar committed Nov 17, 2021
1 parent 524180e commit 602be30
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/Kitar/Dynamodb/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ protected function createClient(array $config)

if (isset($config['key']) && isset($config['secret'])) {
$dynamoConfig['credentials'] = Arr::only(
$config, ['key', 'secret', 'token']
$config,
['key', 'secret', 'token']
);
}

Expand All @@ -103,9 +104,7 @@ protected function createClient(array $config)
*/
public function disconnect()
{
unset($this->client);

$this->client = null;
//
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/ConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ public function it_returns_driver_name()
}

/** @test */
public function it_destroys_connection()
public function it_keeps_dynamodb_client_on_disconnect()
{
$this->connection->disconnect();

$this->assertNull($this->connection->getClient());
$this->assertNotNull($this->connection->getClient());
}

/** @test */
Expand Down

0 comments on commit 602be30

Please sign in to comment.