Create a standalone process in a web application [duplicate]

-1

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

Ex: I need to load a .csv file and pass it to the database, but the file is a bit heavy (about 200mb), I currently pass the file by ajax to a php class and I get the response when it is finished loading in the bank, this is very difficult to view the client, I would like to send the file and follow the loading progress on another screen.

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

I'm not very knowledgeable in web applications, I've read a little bit about dividing these tasks into micro services, but I do not know exactly if that's the solution to the problem.

    
asked by anonymous 15.10.2018 / 23:53

1 answer

0

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

    
16.10.2018 / 02:00