mirror of
https://github.com/yume-chan/ya-webadb.git
synced 2025-10-04 02:09:18 +02:00
feat(adb): expose read blocking debugging option
This commit is contained in:
parent
336e0ffd5d
commit
9cd6fb9296
2 changed files with 9 additions and 10 deletions
|
@ -36,6 +36,7 @@ export interface AdbPacketDispatcherOptions {
|
|||
* Whether to preserve the connection open after the `AdbPacketDispatcher` is closed.
|
||||
*/
|
||||
preserveConnection?: boolean | undefined;
|
||||
debugSlowRead?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -229,7 +230,7 @@ export class AdbPacketDispatcher implements Closeable {
|
|||
let handled = false;
|
||||
await Promise.race([
|
||||
delay(5000).then(() => {
|
||||
if (!handled) {
|
||||
if (this.options.debugSlowRead && !handled) {
|
||||
throw new Error(
|
||||
`packet for \`${socket.service}\` not handled in 5 seconds`,
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue