Skip to content

Commit

Permalink
Merge pull request #1004 from detroitpro/AzureWebjobTimeout
Browse files Browse the repository at this point in the history
added upload with longer timeout
  • Loading branch information
forki committed Nov 30, 2015
2 parents 9eeb022 + 655936c commit bceab0e
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 bceab0e

Please sign in to comment.