dashcam 1.0.1-beta.31 → 1.0.1-beta.33

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.
@@ -159,11 +159,19 @@ class ProcessManager {
159
159
  const isWindows = process.platform === 'win32';
160
160
 
161
161
  if (isWindows) {
162
- logger.info('Windows detected, using taskkill to stop process');
162
+ logger.info('Windows detected, attempting graceful shutdown first');
163
163
  try {
164
- // Use taskkill to forcefully stop the process tree on Windows
164
+ // First try graceful shutdown without /F (force) flag
165
+ // This sends CTRL+C which Node.js can handle
165
166
  const { execSync } = await import('child_process');
166
- execSync(`taskkill /PID ${pid} /F /T`, { stdio: 'ignore' });
167
+ try {
168
+ execSync(`taskkill /PID ${pid} /T`, { stdio: 'ignore', timeout: 5000 });
169
+ logger.info('Sent graceful shutdown signal to process');
170
+ } catch (error) {
171
+ // If graceful shutdown fails or times out, force kill
172
+ logger.warn('Graceful shutdown failed, forcing termination');
173
+ execSync(`taskkill /PID ${pid} /F /T`, { stdio: 'ignore' });
174
+ }
167
175
  } catch (error) {
168
176
  logger.warn('Failed to kill process with taskkill', { error: error.message });
169
177
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dashcam",
3
- "version": "1.0.1-beta.31",
3
+ "version": "1.0.1-beta.33",
4
4
  "description": "Minimal CLI version of Dashcam desktop app",
5
5
  "main": "bin/index.js",
6
6
  "bin": {