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 best solutions below
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
- customising Job and job table in Laravel queue/ rename jobs table
- Laravel 5.3 Queues not working in shared hosting
- how to send laravel reset password email queued
- Running laravel queue:work on a shared hosting
- Laravel Nexmo, bad credentials when using notifications
- Stopping a Laravel Queue after it has finished running
- Laravel 7 Job queue handle method is not working
- 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?
- How to run queue in laravel 5.5 without shell or ssh?
- Laravel 10 everySecond Method doesn't work as expected
- How to run Laravel Queue Job at AWS App Runner?
Related Questions in LARAVEL-JOBS
- Don't kill queue worker on job timeout
- Job timeout and excessive attempt issues
- Laravel Job Batches - deadlock
- Laravel Jobs: File created in job won't delete till queue has stopped
- Is it possible to use Laravel Horizon installed within one module to monitor queues in another module, both of which are using the same Redis?
- How to avoid timeout when running time consuming jobs in Laravel
- Laravel in production server scheduled jobs dispatches twice
- Issues running supervisor on a Laravel dockerized app
- in some exception in laravel job i need retry until get 200 response code
- How to get error message from Job Queue Laravel
- how to send notification to user after dispatching batch job
- Laravel 10 everySecond Method doesn't work as expected
- calling job method from Queue::before Laravel
- laravel queue:work are not processing until I run the job synchronously
- Laravel 9 PHP 8 - Issue with batch cancelling
Related Questions in LARAVEL-BROADCAST
- Listening to user disconnect events with Soketi WebSocket
- Laravel Broadcasting: Private Channel Authentication Issue with Nwidart Module
- How to avoid timeout when running time consuming jobs in Laravel
- Not able to listen to public events in Laravel + ReactJs + Soketi
- What is the proper practice for Chat Messages broadcasting?
- How to achieve EventBroadcast by using presence channel in laravel 8?
- Why Notification is queued in redis without implements ShouldQueue?
- How to restrict sent and received data from Laravel broadcast event?
- laravel echo wont subscribe to private channel even the user is authenticated
- How to send notification to specific users using Laravel Scheduler?
- Why Laravel Authorizing Private Broadcast Channels is not working? "channels.php" not working
- Laravel-echo showing 401 (Unauthorized) for private channel except one user
- Can't receive events broadcasted on Laravel
- Laravel broadcasting every keystroke
- Laravel broadcast with Pusher and laravel-websockets not sending message
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)
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?
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.