Importing a non-trivial OSM file will take some time. As a guide, a 1Mb .osm file takes about 30s on my laptop.
It would be good to return a "processing..." page to the client as soon as the file is received, and process the file in a background task.