Skip to content

Commit

Permalink
added upload with longer timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
detroitpro committed Nov 15, 2015
1 parent 35561a7 commit 655936c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/app/FakeLib/AzureWebJobs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
{
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 655936c

Please sign in to comment.