Skip to content

Commit

Permalink
feat: Add timeout option to adb.pull() in stopRecordingScreen function
Browse files Browse the repository at this point in the history
  • Loading branch information
didental committed Feb 22, 2024
1 parent e44ec98 commit 2c79b5e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/commands/recordscreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const SCREENRECORD_BINARY = 'screenrecord';
const DEFAULT_EXT = '.mp4';
const MIN_EMULATOR_API_LEVEL = 27;
const FFMPEG_BINARY = `ffmpeg${system.isWindows() ? '.exe' : ''}`;
const ADB_PULL_TIMEOUT = 5 * 60 * 1000;

/**
*
Expand Down Expand Up @@ -134,7 +135,7 @@ export async function stopRecordingScreen(options = {}) {
for (const pathOnDevice of this._screenRecordingProperties.records) {
const relativePath = path.resolve(tmpRoot, path.posix.basename(pathOnDevice));
localRecords.push(relativePath);
await this.adb.pull(pathOnDevice, relativePath, { timeout: 5 * 60 * 1000 });
await this.adb.pull(pathOnDevice, relativePath, { timeout: ADB_PULL_TIMEOUT });
await this.adb.rimraf(pathOnDevice);
}
let resultFilePath = /** @type {string} */ (_.last(localRecords));
Expand Down

0 comments on commit 2c79b5e

Please sign in to comment.