W
W
Wade2k2017-07-27 16:27:38
PHP
Wade2k, 2017-07-27 16:27:38

How to limit PhantomJS execution time from php?

Greetings
I'm running in php - shell_exec ("/phantomjs .....")
Everything is fine, but sometimes it specifically freezes - does not return a result and does not complete.
Is it possible to force limit phantomjs maximum execution time?
Or will I have to write a script that looks at how long phantomjs is running and kill it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
Hazrat Hajikerimov, 2017-07-27
@hazratgs

Maybe it's worth doing in phantom.js itself phantom.exit()?
For example, we did not receive a result from the request or an error occurred, as well as, if you wish, start the stopwatch and turn it off when a certain time is reached:

setTimeout(() => phantom.exit(), 60000) // остановит процесс через 60 сек.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question