Skip to content

Commit 782d3d1

Browse files
committed
added one hour timeout on upload
1 parent 52e931b commit 782d3d1

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/aggregator-cli/Instances/FunctionRuntimePackage.cs

+10-7
Original file line numberDiff line numberDiff line change
@@ -174,17 +174,20 @@ private async Task<bool> UploadRuntimeZip(InstanceName instance, IAzure azure)
174174
// Deploy from zip asynchronously. The Location header of the response will contain a link to a pollable deployment status.
175175
var body = new ByteArrayContent(zipContent);
176176
using (var client = new HttpClient())
177-
using (var request = await kudu.GetRequestAsync(HttpMethod.Post, $"api/zipdeploy"))
178177
{
179-
request.Content = body;
180-
using (var response = await client.SendAsync(request))
178+
client.Timeout = TimeSpan.FromMinutes(60);
179+
using (var request = await kudu.GetRequestAsync(HttpMethod.Post, $"api/zipdeploy"))
181180
{
182-
bool ok = response.IsSuccessStatusCode;
183-
if (!ok)
181+
request.Content = body;
182+
using (var response = await client.SendAsync(request))
184183
{
185-
logger.WriteError($"Upload failed with {response.ReasonPhrase}");
184+
bool ok = response.IsSuccessStatusCode;
185+
if (!ok)
186+
{
187+
logger.WriteError($"Upload failed with {response.ReasonPhrase}");
188+
}
189+
return ok;
186190
}
187-
return ok;
188191
}
189192
}
190193
}

0 commit comments

Comments
 (0)