Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.

Commit e407e84

Browse files
committed
disable sandbox in finally
1 parent da4af61 commit e407e84

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Websocket/CanWebsocket.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,11 @@ public function onOpen(Server $server, $swooleRequest)
7474
$this->websocket->setContainer($application);
7575
$this->websocket->call('connect', $illuminateRequest);
7676
}
77-
// disable and recycle sandbox resource
78-
$this->sandbox->disable();
7977
} catch (Exception $e) {
8078
$this->logServerError($e);
79+
} finally {
80+
// disable and recycle sandbox resource
81+
$this->sandbox->disable();
8182
}
8283
}
8384

@@ -112,10 +113,11 @@ public function onMessage(Server $server, Frame $frame)
112113
} else {
113114
$this->websocketHandler->onMessage($frame);
114115
}
115-
// disable and recycle sandbox resource
116-
$this->sandbox->disable();
117116
} catch (Exception $e) {
118117
$this->logServerError($e);
118+
} finally {
119+
// disable and recycle sandbox resource
120+
$this->sandbox->disable();
119121
}
120122
}
121123

0 commit comments

Comments
 (0)