In my laravel application i do a form submit to execute a time consuming task by calling shell_exec(my_time_conusming_Script.sh) . The process executes successfully on the background. But the connection with the frontent is found to be lost. I find that the form submitting the data stops after processing for sometime. I had a return redirect()->back()->with('success',$message); after the shell_exec. But the redirect is not found to be working. if i comment out the time consuming process the redirect works. is any timeout happening. How should i get the redirect working after the time consuming process completes.Should i use laravel queues and jobs and broadcasting.
How to avoid timeout when running time consuming jobs in Laravel
85 views Asked by Tanzeem At
1
There are 1 answers
Related Questions in PHP
- How to add the dynamic new rows from my registration form in my database?
- Issue in payment form gateway
- How to create a facet for WP gridbuilder that displays both parent and child custom fields?
- Function in anonymous Laravel Blade component
- How to change woocomerce or full wordpress currency with value from USD to AUD
- General questions about creating a custom theme Moodle CMS
- How to add logging to an abstract class in php
- error 500 on IIS FastCGI but no clue despite multiple error loggings activated
- Composer installation fails and reverts ./composer.json and ./composer.lock to original content
- How to isolate PHP apps from each other on a local machine(Windows or Linux)?
- Laravel: Using belongsToMany relationship with MongoDB
- window.location.href redirects but is causing problems on the webpage
- Key provided is shorter than 256 bits, only 64 bits provided
- Laravel's whereBetween method not working with two timestamps
- Implementing UUID as primary key in Laravel intermediate table
Related Questions in LARAVEL
- Function in anonymous Laravel Blade component
- Composer installation fails and reverts ./composer.json and ./composer.lock to original content
- Laravel: Using belongsToMany relationship with MongoDB
- Laravel's whereBetween method not working with two timestamps
- Implementing UUID as primary key in Laravel intermediate table
- Resolving ElephantIO ServerConnectionFailureException: Error establishing connection to server
- Undefined function getAdminPanelUrlPrefix()'error in Laravel SaaS project after installing chatmessenger
- PHP Laravel SQLServer could not find driver
- Laravel installation via Composer results in connection timeout error
- Is there a way of showing content in a Statamic antlers template if a user is authenticated?
- Livewire component JS script Uncaught SyntaxError: Unexpected token
- is there a solution to run cron job command in cpanel only from my cPanel host?
- Prevent a webpage from navigating away
- Deploy Flutter and Laravel php mobile app on the host server
- Please how I fetch user account balance, withdrawals, Loans and Transactions to display in the dashboard?
Related Questions in LARAVEL-QUEUE
- Laravel Vapor Queue Dynamic DB Connection Issue for Different Requests
- Error while attempting to run 'php artisan queue:work' command
- How to send laravel 10 fortify reset password email via database queue system?
- Don't kill queue worker on job timeout
- Job timeout and excessive attempt issues
- Laravel | Laravel Queue Job Is Not Being Processed
- Laravel Job Batches - deadlock
- Laravel Job - Requeue or "Unfail" Specific Exceptions
- Laravel Jobs: File created in job won't delete till queue has stopped
- How to avoid timeout when running time consuming jobs in Laravel
- Queued job in Laravel runs twice, but only intermittently
- Redis queued jobs are failing randomly due to Illuminate\Database\Eloquent\ModelNotFoundException ยท No query results for model
- in some exception in laravel job i need retry until get 200 response code
- Laravel failed job is not retrying
- How to get error message from Job Queue Laravel
Related Questions in LARAVEL-JOBS
- Expire for Laravel Jobs
- Exception Serialization of 'Closure' is not allowed in Queue.php (line 127)
- Laravel queue, redirect after dispatch
- Passing data to Queue Job gives 404 - Not other Error
- Laravel - cannot send message without a sender address
- Laravel 7 run queue:listen from route on shared hosting
- Pdf Merge Taking too long in laravel job
- How to execute laravel job at low priority?
- How to update horizon.php in Laravel and how to count proccesses in a queue?
- Laravel 10 everySecond Method doesn't work as expected
- how to send notification to user after dispatching batch job
- How to get error message from Job Queue Laravel
- Why did I get a timed out error after queuing up 7k jobs?
- laravel queue: array_merge(): Expected parameter 2 to be an array, int given
- Creating a structure with Jobs, Events, Listeners, Queues in Laravel 8
Related Questions in LARAVEL-BROADCAST
- Why BroadCastEvent are queued in Laravel? How to stop that?
- Not able to listen to public events in Laravel + ReactJs + Soketi
- How to avoid console error 403 when backend not give return
- Class App\Http\Middleware\Authenticate:api does not exist on Broadcasting
- Laravel broadcast with Pusher and laravel-websockets not sending message
- Laravel function "event" not working when broadcasting an event
- How to create private channel name dynamically
- Laravel broadcasting every keystroke
- Vue.js component not updating after notification is received via websocket in Laravel
- Laravel Broadcasting - Private Channels Accessible Without Bearer Token
- Node with Laravel Echo and Socket.io but no response
- How to restrict sent and received data from Laravel broadcast event?
- Why Notification is queued in redis without implements ShouldQueue?
- VueJS - Can't access assigned this.property declared within mounted() in mounted()
- Laravel-echo showing 401 (Unauthorized) for private channel except one user
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Although increasing the timeout may be a solution, I do not recommend it as the client should receive a response in the shortest time possible for an optimal user experience. It is not clear to me whether the outcome of the script execution affects the response to be returned to the client, i.e. with a success message rather than an error message. If this isn't the case, and you want to avoid dealing with queues that can be more complex, I would suggest using terminable middleware, and then return a success response to your client and the middleware will take care of executing right after the script runs. Please note that this will only work if your web server uses FastCGI.