Is there any way to set timeout at child_process spawn?

  child-process, javascript, spawn

is there any way to set timeout option at child_process spawn?

Here is my code. But I think it doesn’t work….
When I remove this : , { timeout: 100 * 60 } , it works.

const { spawn } = require('child_process')

function spawnPython() {
  const job2 = new CronJob({
    cronTime: '36 17 * * *',
    onTick() {
      const smartstoreReview = spawn(
        'python3', ['smartstore_review.py'], { timeout: 100 * 60 }
      )
.
.
.

Source: Ask Javascript Questions

LEAVE A COMMENT