We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d6ef1b commit 8edb5f4Copy full SHA for 8edb5f4
cleanup.js
@@ -1,6 +1,16 @@
1
+const axios = require('axios');
2
const isWindows = process.platform === 'win32';
3
-const kill = (process) => {
4
+const kill = async (process) => {
5
+ try {
6
+ // Call the shutdown API
7
+ await axios.post('http://localhost:5000/shutdown');
8
+ console.log('Shutdown API called successfully.');
9
+ } catch (error) {
10
+ console.error('Error calling shutdown API:', error);
11
+ }
12
+
13
+ // Fallback if API fails or for local process termination
14
if (isWindows) {
15
const kill = require('tree-kill');
16
kill(process.pid);
0 commit comments