mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-19 22:25:22 +02:00
fix: handle potential null data in PID extraction for runCommand function
This commit is contained in:
@@ -119,7 +119,7 @@ export const runCommand = async (scheduleId: string) => {
|
||||
async (data) => {
|
||||
if (writeStream.writable) {
|
||||
// we need to extract the PID and Schedule ID from the data
|
||||
const pid = data.match(/PID: (\d+)/)?.[1];
|
||||
const pid = data?.match(/PID: (\d+)/)?.[1];
|
||||
|
||||
if (pid) {
|
||||
await updateDeployment(deployment.deploymentId, {
|
||||
@@ -152,7 +152,7 @@ export const runCommand = async (scheduleId: string) => {
|
||||
`;
|
||||
await execAsyncRemote(serverId, command, async (data) => {
|
||||
// we need to extract the PID and Schedule ID from the data
|
||||
const pid = data.match(/PID: (\d+)/)?.[1];
|
||||
const pid = data?.match(/PID: (\d+)/)?.[1];
|
||||
if (pid) {
|
||||
await updateDeployment(deployment.deploymentId, {
|
||||
pid,
|
||||
|
||||
Reference in New Issue
Block a user