Ravi Shekhar

Ravi Shekhar

  • 358
  • 4.5k
  • 2.1m

MVC web api is getting failed while long running task inside

Oct 13 2017 7:11 AM
Chaps
 
C# MVC web api is getting failed.
 
Inside api we are procesing 2 gb file and moving from one location to another. It is taking time almost(3-4 minute). When I hit api through postman or soapui it is failing after 30 sec approx and response come with 500 internal server error - 
 
Response : 
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Service Unavailable</title>
<style type="text/css">
body, p, h1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
}
h2 {
font-family: Arial, Helvetica, sans-serif;
color: #b10b29;
}
</style>
</head>
<body>
<h2>Service Unavailable</h2>
<p>The service is temporarily unavailable. Please try again later.</p>
</body>
</html>
Look like service crashed.
 
I noticed one thing here. My work is still going on in background. I mean 2 gb file is moving in background and it completes in 3-4 minute.
 
Can anyone pleae help me to get rid of the service failure.
 
Regards, Ravi 
 

Answers (1)