mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-22 17:34:27 +01:00
add Connection.reconnect() to serverless driver
This commit is contained in:
@@ -223,6 +223,17 @@ export class Connection {
|
||||
this.isOpen = false;
|
||||
await this.session.close();
|
||||
}
|
||||
|
||||
reconnect(): void {
|
||||
try {
|
||||
if (this.isOpen) {
|
||||
this.close();
|
||||
}
|
||||
} finally {
|
||||
this.session = new Session(this.config);
|
||||
this.isOpen = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user