chore: lint
This commit is contained in:
@@ -89,7 +89,7 @@ export class RemoteBrowser {
|
|||||||
maxConcurrency: 1,
|
maxConcurrency: 1,
|
||||||
maxRepeats: 1,
|
maxRepeats: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
private lastEmittedUrl: string | null = null;
|
private lastEmittedUrl: string | null = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -411,22 +411,22 @@ export class RemoteBrowser {
|
|||||||
public async switchOff(): Promise<void> {
|
public async switchOff(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
await this.interpreter.stopInterpretation();
|
await this.interpreter.stopInterpretation();
|
||||||
|
|
||||||
if (this.screencastInterval) {
|
if (this.screencastInterval) {
|
||||||
clearInterval(this.screencastInterval);
|
clearInterval(this.screencastInterval);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.client) {
|
if (this.client) {
|
||||||
await this.stopScreencast();
|
await this.stopScreencast();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.browser) {
|
if (this.browser) {
|
||||||
await this.browser.close();
|
await this.browser.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.screenshotQueue = [];
|
this.screenshotQueue = [];
|
||||||
//this.performanceMonitor.reset();
|
//this.performanceMonitor.reset();
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error('Error during browser shutdown:', error);
|
logger.error('Error during browser shutdown:', error);
|
||||||
}
|
}
|
||||||
@@ -649,21 +649,21 @@ export class RemoteBrowser {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.isProcessingScreenshot = true;
|
this.isProcessingScreenshot = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const optimizedScreenshot = await this.optimizeScreenshot(payload);
|
const optimizedScreenshot = await this.optimizeScreenshot(payload);
|
||||||
const base64Data = optimizedScreenshot.toString('base64');
|
const base64Data = optimizedScreenshot.toString('base64');
|
||||||
const dataWithMimeType = `data:image/jpeg;base64,${base64Data}`;
|
const dataWithMimeType = `data:image/jpeg;base64,${base64Data}`;
|
||||||
|
|
||||||
this.socket.emit('screencast', dataWithMimeType);
|
this.socket.emit('screencast', dataWithMimeType);
|
||||||
logger.debug('Screenshot emitted');
|
logger.debug('Screenshot emitted');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error('Screenshot emission failed:', error);
|
logger.error('Screenshot emission failed:', error);
|
||||||
} finally {
|
} finally {
|
||||||
this.isProcessingScreenshot = false;
|
this.isProcessingScreenshot = false;
|
||||||
|
|
||||||
if (this.screenshotQueue.length > 0) {
|
if (this.screenshotQueue.length > 0) {
|
||||||
const nextScreenshot = this.screenshotQueue.shift();
|
const nextScreenshot = this.screenshotQueue.shift();
|
||||||
if (nextScreenshot) {
|
if (nextScreenshot) {
|
||||||
|
|||||||
Reference in New Issue
Block a user