feat(ssh-multiplexing): add connection age metadata handling to improve multiplexed connection management
This commit is contained in:
parent
b433f17dac
commit
40f2471c5a
1 changed files with 6 additions and 5 deletions
|
|
@ -44,6 +44,12 @@ public static function ensureMultiplexedConnection(Server $server): bool
|
|||
return self::establishNewMultiplexedConnection($server);
|
||||
}
|
||||
|
||||
// Connection exists, ensure we have metadata for age tracking
|
||||
if (self::getConnectionAge($server) === null) {
|
||||
// Existing connection but no metadata, store current time as fallback
|
||||
self::storeConnectionMetadata($server);
|
||||
}
|
||||
|
||||
// Connection exists, check if it needs refresh due to age
|
||||
if (self::isConnectionExpired($server)) {
|
||||
return self::refreshMultiplexedConnection($server);
|
||||
|
|
@ -278,11 +284,6 @@ public static function getConnectionAge(Server $server): ?int
|
|||
*/
|
||||
public static function refreshMultiplexedConnection(Server $server): bool
|
||||
{
|
||||
Log::debug('Refreshing SSH multiplexed connection', [
|
||||
'server' => $server->name ?? $server->ip,
|
||||
'age' => self::getConnectionAge($server),
|
||||
]);
|
||||
|
||||
// Close existing connection
|
||||
self::removeMuxFile($server);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue