Let’s just say I have a function on a controller with some queries to database filtering and ordering results. I’ve already checked that 15000ms is enough for Adonis to abort that query. I solved that using paginate, creating indexes etc etc…
Now I have a bigger problem, I have to generate a Cycle, it looks like:
Select all HOSTS from a table that have one or many TEMPLATES assigned
-----For each TEMPLATE assigned
-----------For each ITEM in this TEMPLATE which has been marked as “useful” generate a new object on a new table.
This process has to build 300000 aprox. new models, and insertions on database (HOSTS with TEMPLATES ASSIGNED(1200)AVERAGE OF ASSIGNED TEMPLATES BY HOST (1) AVERAGE OF ITEMS PER TEMPLATE(250)).
I decided not to put this heavy process on frontend because a closed window could just stop the execution so I think that it’s place would be Adonis Backend.
Is there any way to call the api, launch this process and see the progress from frontend? Where would it fits better, hook? controller? ace command? migration file? How could I check for progress from frontend?
Thank you and sorry for my poor english.