Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions app/Services/Utils/RedisCacheService.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,25 @@ public function __destruct()
if (is_resource($res)) $metadata = @stream_get_meta_data($res);
}
} catch (\Throwable $ignored) {}
Log::error
(
sprintf
// Check if Laravel app is still available before logging
if (app()->bound('config')) {
Log::error
(
"RedisCacheService::__destruct %s %s %s",
$ex->getCode(),
$ex->getMessage(),
var_export($metadata, true)
)
);
sprintf
(
"RedisCacheService::__destruct %s %s %s",
$ex->getCode(),
$ex->getMessage(),
var_export($metadata, true)
)
);
}
}
catch(\Exception $ex){
Log::warning($ex);
// Check if Laravel app is still available before logging
if (app()->bound('config')) {
Log::warning($ex);
}
}
}

Expand Down Expand Up @@ -324,4 +330,4 @@ public function ttl($key)
return (int)$conn->ttl($key);
}, 0);
}
}
}
6 changes: 6 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
<testsuites>
<testsuite name="Application Test Suite">
<directory>./tests/</directory>
<exclude>./tests/OpenTelemetry/</exclude>
<exclude>./tests/TestCase.php</exclude>
</testsuite>
<testsuite name="OTEL">
<directory>./tests/OpenTelemetry/</directory>
<exclude>./tests/OpenTelemetry/ExampleTest.php</exclude>
</testsuite>
</testsuites>
<php>
Expand Down
Empty file added tests/OpenTelemetry/.gitkeep
Empty file.
17 changes: 17 additions & 0 deletions tests/OpenTelemetry/ExampleTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Tests\OpenTelemetry;

use Tests\TestCase;
class ExampleTest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function testBasicTest()
{
$this->assertTrue(true);
}
}