In general, there is a controller for symfony where a large CSV file is loaded and processed, ajax is sending a file, it is loaded and processing is in while, at this time I send requests to the same controller with a timer and check how many records have already passed to the database. Accordingly, I display the progress bar.

The problem is the following, after the first request with the file is gone, the script seems to freeze, all ajax requests that pull the status reach the server and wait for the file processing to end. I get a packet of answers equal to the number of requests.

It happens on Apache, linux standard settings. On Openserver, during the processing of the file, I received progress.

  • The default session mechanism blocks the file to be written and read, not allowing two requests to exist simultaneously. Most likely, you have it. - etki
  • $ request-> getSession () -> save (); I write this in code like this - Serge Esmanovich

1 answer 1

In general, I added $ request-> getSession () -> save () to the loop; Before that it was only at the top of the controller. If anyone knows how to make the progress bar a more convenient way to share.