Asp.Net Core 2.0: Simple way to execute long runni

2019-06-01 00:12发布

问题:

I have a page where the user can select multiple files and upload them.

Once the files are buffered in the server, they are deserialized, and the object graphs are stored using Entity Framework Core 2 and SQL Server.

All this happens within a controller action.

The problem is that when the file is a little bit bigger, this collection of tasks can take about 5 minutes to complete, and because of that, I get a 502 error (probably a timeout).

To solve this problem, I had the idea of reporting progress. So it would prevent the timeout. I researched, and some people suggested using SignalR. But I've found out that SignalR is not yet available for Asp.Net Core.

So how can I solve this issue in a basic way? I would like to report progress from my controller action. But if this is complicated stuff to do, then how can I prevent the timeout from happening?

I am using Angular 4.3.5 by the way.