MCPcopy
hub / github.com/mruniquehacker/Knightbot-MD / restartProcess

Function restartProcess

commands/update.js:177–191  ·  view source on GitHub ↗
(sock, chatId, message)

Source from the content-addressed store, hash-verified

175}
176
177async function restartProcess(sock, chatId, message) {
178 try {
179 await sock.sendMessage(chatId, { text: '✅ Update complete! Restarting…' }, { quoted: message });
180 } catch {}
181 try {
182 // Preferred: PM2
183 await run('pm2 restart all');
184 return;
185 } catch {}
186 // Panels usually auto-restart when the process exits.
187 // Exit after a short delay to allow the above message to flush.
188 setTimeout(() => {
189 process.exit(0);
190 }, 500);
191}
192
193async function updateCommand(sock, chatId, message, zipOverride) {
194 const senderId = message.key.participant || message.key.remoteJid;

Callers 1

updateCommandFunction · 0.85

Calls 1

runFunction · 0.85

Tested by

no test coverage detected