Create a standalone process in a web application

Asked

Viewed 42 times

-1

I have a web system with an mvc architecture, it simply loads information from a bank and displays on the screen. I need to create two features that run regardless of a usurer is accessing the page.

Ex: I need to upload a file. csv and pass it to the bank, but the file is a bit heavy (about 200mb), currently I pass the file by ajax to a php class and I get the answer when it has finished being loaded in the bank, this locks very much the client view, would like to upload the file and follow in another screen the progress of the upload.

This is an example, I have some other tasks that take some time, generally I just wanted to run them and make them run alone on the server.

I don’t have much knowledge in web applications read a little about dividing these tasks into micro services, but I don’t know exactly if this is the solution to the problem.

  • Post as you import the data to the bank, it is likely that the way this is done can be optimized

  • There are several different techniques in the closing links above. If nothing resolves, please [Dit] your post giving more details of the specific need.

1 answer

0

if your server is linux(probably) you can solve this using cron job. search google for crontab or via command line man crontab , basically you should create a php script and run via cli php nomedoarquivo.php

  • here is an example in English: https://stackoverflow.com/questions/22358382/execute-php-script-in-cron-job

Browser other questions tagged

You are not signed in. Login or sign up in order to post.