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