From 655936c58b0a60fbcd046032aace69baae8ff0c0 Mon Sep 17 00:00:00 2001 From: detroitpro Date: Sun, 15 Nov 2015 16:31:28 -0500 Subject: [PATCH] added upload with longer timeout --- src/app/FakeLib/AzureWebJobs.fs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/app/FakeLib/AzureWebJobs.fs b/src/app/FakeLib/AzureWebJobs.fs index c61952be289..31184a04dab 100644 --- a/src/app/FakeLib/AzureWebJobs.fs +++ b/src/app/FakeLib/AzureWebJobs.fs @@ -13,6 +13,15 @@ type WebJobType = | Continuous | Triggered +type WebClientWithTimeout() = + inherit WebClient() + member val Timeout = 600000 with get, set + + override x.GetWebRequest uri = + let r = base.GetWebRequest(uri) + r.Timeout <- x.Timeout + r + /// WebJob type type WebJob = { @@ -64,7 +73,7 @@ let private deployWebJobToWebSite webSite webJob = let uploadApi = Uri(webSite.Url, sprintf"api/zip/site/wwwroot/App_Data/jobs/%s/%s" (jobTypePath webJob.JobType) webJob.Name) let filePath = webJob.PackageLocation tracefn "Deploying %s webjob to %O" filePath uploadApi - use client = new WebClient() + use client = new WebClientWithTimeout() client.Credentials <-NetworkCredential(webSite.UserName, webSite.Password) client.UploadData(uploadApi,"PUT",File.ReadAllBytes(filePath)) |> ignore