简体   繁体   中英

ASp.net MVC Long running controller task

My Controller action takes long time to run (expected). In the below code ,

ProcessImportFileAPI(HoldAPI) 

timesout after 1 hour.

public JsonResult DataFileUpload(string positionDate)
        {
            // Reset validation error collection
            ImportDataValidationErrors = new List<ImportFileRecord>();
            string[] errs;
            try
            {
                var HoldAPI = "SomeAPI" 
                retDictAPI = ProcessImportFileAPI(HoldAPI);
                string ReturnVal = "Import is successful";
                return Json(ReturnVal); //never return because of TIMEOUT.

            }

Controller action is performing all taks correctly, but I am unable to return value back to view because of timeout. How can I solve this? any pointers?

我使用异步控制器来解决我的问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM