mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-17 01:15:19 +00: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) => {
|
async (data) => {
|
||||||
if (writeStream.writable) {
|
if (writeStream.writable) {
|
||||||
// we need to extract the PID and Schedule ID from the 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) {
|
if (pid) {
|
||||||
await updateDeployment(deployment.deploymentId, {
|
await updateDeployment(deployment.deploymentId, {
|
||||||
@@ -152,7 +152,7 @@ export const runCommand = async (scheduleId: string) => {
|
|||||||
`;
|
`;
|
||||||
await execAsyncRemote(serverId, command, async (data) => {
|
await execAsyncRemote(serverId, command, async (data) => {
|
||||||
// we need to extract the PID and Schedule ID from the 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) {
|
if (pid) {
|
||||||
await updateDeployment(deployment.deploymentId, {
|
await updateDeployment(deployment.deploymentId, {
|
||||||
pid,
|
pid,
|
||||||
|
|||||||
Reference in New Issue
Block a user