Skip to content

Commit bdbc5a6

Browse files
authored
Update destructor in MemorySessionPool.php
1 parent bf24f8b commit bdbc5a6

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/Sessions/MemorySessionPool.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,13 @@ public function __construct(Retry &$retry)
2525
*/
2626
public function __destruct()
2727
{
28-
foreach (static::$sessions as $session_id => $session)
29-
{
30-
if (static::$retry==null){
31-
static::$retry = new Retry();
28+
foreach (static::$sessions as $session_id => $session) {
29+
try {
30+
static::$retry->retry(function () use ($session) {
31+
$session->delete();
32+
}, true);
33+
} catch (\Exception $e) {
3234
}
33-
static::$retry->retry(function () use ($session) {
34-
$session->delete();
35-
},true);
3635
}
3736
}
3837

0 commit comments

Comments
 (0)