For one of the Laravel API endpoints, I want to set a different execution time from the global one in PHP. For example, if the function takes more than 5 seconds then just exit and return an error message like Please try again later. I have tried: set_time_limit(5); on top of the function, but I cannot catch it and return a custom error message.
Asked
Active
Viewed 249 times
0
-
see also max_execution_time, don't forgot that when the time is reached php will return a fatal error and check the php doc about the function. – Med.ZAIRI Mar 07 '22 at 16:05
-
Maybe this question will help you: https://stackoverflow.com/questions/48689146/can-i-handle-jobs-timeout-in-laravel – Lenny4 Mar 07 '22 at 21:00