dashcam 1.4.13-beta.1 → 1.4.13-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/dashcam.js +4 -0
- package/lib/systemInfo.js +21 -0
- package/package.json +1 -1
package/bin/dashcam.js
CHANGED
|
@@ -6,6 +6,7 @@ import { logger, setVerbose } from '../lib/logger.js';
|
|
|
6
6
|
import { APP } from '../lib/config.js';
|
|
7
7
|
import { createPattern } from '../lib/tracking.js';
|
|
8
8
|
import { processManager } from '../lib/processManager.js';
|
|
9
|
+
import { cleanupSystemInfo } from '../lib/systemInfo.js';
|
|
9
10
|
import { fileURLToPath } from 'url';
|
|
10
11
|
import { dirname } from 'path';
|
|
11
12
|
import path from 'path';
|
|
@@ -39,6 +40,9 @@ async function gracefulShutdown(signal) {
|
|
|
39
40
|
logger.info('Received shutdown signal, cleaning up...', { signal });
|
|
40
41
|
|
|
41
42
|
try {
|
|
43
|
+
// Clean up systeminformation child processes first to prevent stack overflow
|
|
44
|
+
cleanupSystemInfo();
|
|
45
|
+
|
|
42
46
|
// Check if there's an active recording and stop it
|
|
43
47
|
if (processManager.isRecordingActive()) {
|
|
44
48
|
logger.info('Stopping active recording before exit...');
|
package/lib/systemInfo.js
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
import si from 'systeminformation';
|
|
2
2
|
import { logger } from './logger.js';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Cleanup systeminformation child processes to prevent stack overflow on exit
|
|
6
|
+
*/
|
|
7
|
+
export function cleanupSystemInfo() {
|
|
8
|
+
try {
|
|
9
|
+
logger.debug('Cleaning up systeminformation processes...');
|
|
10
|
+
// The systeminformation library keeps child processes running
|
|
11
|
+
// We need to clean them up to prevent stack overflow on Windows
|
|
12
|
+
if (si && typeof si.powerShellRelease === 'function') {
|
|
13
|
+
si.powerShellRelease();
|
|
14
|
+
}
|
|
15
|
+
logger.debug('Systeminformation cleanup complete');
|
|
16
|
+
} catch (error) {
|
|
17
|
+
logger.debug('Error cleaning up systeminformation', { error: error.message });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
4
21
|
/**
|
|
5
22
|
* Collects comprehensive system information including CPU, memory, OS, and graphics data.
|
|
6
23
|
* This matches the data format expected by the Dashcam backend (same as desktop app).
|
|
@@ -30,6 +47,10 @@ export async function getSystemInfo() {
|
|
|
30
47
|
} catch (error) {
|
|
31
48
|
logger.debug('Graphics info timed out, using empty graphics data');
|
|
32
49
|
}
|
|
50
|
+
|
|
51
|
+
// Immediately cleanup PowerShell processes after collection to prevent race conditions
|
|
52
|
+
// This prevents the stack overflow issue if an error occurs later during upload
|
|
53
|
+
cleanupSystemInfo();
|
|
33
54
|
|
|
34
55
|
const systemInfo = {
|
|
35
56
|
cpu: {
|