Hi, we have a custom c# function that handles a Bill Of Material as incoming JSON DataSet.
The function then updates / Inserts records for all the parts in the BOM and then does the same for the BOM structure with the PartMTL.
the default timeout for function calls seems to be set at 4 minutes, we had Epicor increased the server-side timeout from 4min to o / not set which they said will make it timeout after 30min due to SQL DB timeout settings.
The behavior I am seeing is that our Application makes a call EpicorRest.EfxPostAsync(ā¦)
and we still get a timeout after 4minutes but even though the client threw this error, the server side still runs. If there were no issues we see the results eventually by trying to call the relevant data again to see if it updated but if there was an issue we donāt know what it was since we werenāt connected to receive the reply anymore.
I have updated the EpicorRest.Timeout to be something much higher than 4min to make sure that is not what we are hitting (900 * 1000)ms
Error Message: GatewayTimeout
Unexpected character encountered while parsing value: <. Path āā, line 0, position 0.
<head>
<meta content='text/html; charset=utf-8' http-equiv='content-type' />
<style type='text/css'>
body {
font-family: Arial;
margin-left: 40px;
}
img {
border: 0 none;
}
#content {
margin-left: auto;
margin-right: auto
}
#message h2 {
font-size: 20px;
font-weight: normal;
color: #000000;
margin: 34px 0px 0px 0px
}
#message p {
font-size: 13px;
color: #000000;
margin: 7px 0px 0px0px
}
#errorref {
font-size: 11px;
color: #737373;
margin-top: 41px
}
</style>
<title>Service unavailable</title>
</head>
<body>
<div id='content'>
<div id='message'>
<h2>Our services aren't available right now</h2>
<p>We're working to restore all services as soon as possible. Please check back soon.</p>
</div>
<div id='errorref'>
<span>20241204T222837Z-15fdbff69c5knmsnhC1CH18zpg0000000gwg00000000w16t </span>
</div>
</div>
</body>
</html>
If I call this to schedule the Function that takes a longer time to run. Is there a way I can wait for the response back? as that returns useful information to the user.
As Kevin says, we really donāt want to lock up the UI for that. There are lots of articles about handling ālong runningā API tasks. Hereās one:
we use services like: PartSvcContract, PartXRefMfgSvcContract, EngWorkBenchSvcContract (for Bom Structure)
but then update the relevant columns manually and set the record RowMod to āUā
the current workflow is a user saves the most up to date version of the BOM and then will go on to the next step to get parts ordered as soon as the updated part info is available. So alerting the user to the status as soon as possible is ideal.
This function being large (~2000 lines with whitespace) there are a lot of statuses that could require the user to try again after fixing some relevant part of their BOM data, and reporting these messages back is also a priority.
The hard thing is, the user is sitting there wondering why the print job didnāt print, but I donāt know that till itās done and writes the error message so theyāll be waiting there regardless, but the ālocking up the UIā is ugly and causes people to get angry so I need to stop that ASAP.
Trying to re-write my integration to send XML of all relevant fields to make it even speedier.
for this we are calling this with an ASync call so the UI isnāt locked up, but has a wait screen going, which shows the overall status of what function is being called so they get some progress with that.
there are two statuses that we use, one happens right away if we notice something incorrect on the incoming validation of the dataset and we return a dataset in return with a status message for each offending part.
otherwise we just have an overall status message that marks where in the function / section of code we are running with what specifics are relevant, that way if an error is thrown we know what the last step we were working on was.
The worst part about the customization I made was I tested it on all small jobs⦠and then one machine operator was like, I sit here and run one job for 8 hours making hundreds of parts needing labels⦠Well, when you submit a job for 400-500 labels vs one for 20 labels thatās when you get the 4 minutes of spinning death.