How do I run a long-running deploy hook?

Hey guys,

I have a deploy hook that runs a heavy job on the server, which sometimes takes more than one hour. You guys seem to limit the amount of time for it to run to 1 hour. I can I make sure it can run beyond that?

Thanks.

Running a deploy hook for that long can be problematic, and we time-out any hooks that run for longer than 1 hour to avoid issues. To get around this, I’d suggest that you daemonize your the long-running process like so: nohup <command> &> /dev/null &

The “nohup” will ignore any hangup signals, and any output is sent to /dev/null, while the process is daemonized with “&”. This will ensure that the deployment can succeed and leave the process running in the background.

I hope this helps!

You must be logged in to answer this question