An Azure service that provides an event-driven serverless compute platform.
python function app throw exception after deployed
zehou zhang
1
Reputation point
ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))".
My function throw exception after deployed, any one knows why?
tokenRequestModel = {
"Domain": domain,
"UserName":username,
"Passward":password,
"Op":"GetToken"
}
unsuccessful = {}
# load channels map from csv file based on json configuration
channelMaps = yield context.call_activity('LoadSeChannelsCsvActivity', filename)
# get token
token = yield context.call_activity('SeServerOpActivity', tokenRequestModel)
stepList = list(divide_chunks(data, quota))
size = len(stepList)
# update chunk processing
for chunk in range(size):
start = context.current_utc_datetime.timestamp()
eachstep = stepList[chunk]
for each in eachstep:
key = each["n"]
url = channelMaps[key]
updateValueRequestModel = {
"Token": token,
"Url":url,
"Value":each["v"],
"Op":"UpdateValue"
}
key = each["n"]
url = channelMaps[key]
headers = { "Authorization": f"Bearer {token}", "Content-Type":"application/json" }
try:
updateValue = yield context.call_activity('SeServerOpActivity', updateValueRequestModel)
except Exception as V:
unsuccessful[key] = {
"value": each["v"],
"message": V
}
eachTimeout = context.current_utc_datetime + timedelta(seconds=1)
yield context.create_timer(eachTimeout)
# click for next minute after refresh of quota
if chunk != size - 1:
end = context.current_utc_datetime.timestamp()
processingtime = (end - start)
deduct = 60 - processingtime
if deduct > 0:
deadline = context.current_utc_datetime + timedelta(seconds=deduct)
yield context.create_timer(deadline)
return {"data":unsuccessful}
Azure Functions
Azure Functions
Sign in to answer