Skip to content

Commit

Permalink
Merge pull request #177 from jread-usgs/master
Browse files Browse the repository at this point in the history
using retry on waitUntilFinished
  • Loading branch information
Jordan S Read committed Jun 19, 2015
2 parents edb22b8 + beaadff commit 992d522
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: geoknife
Type: Package
Title: Geo-web processing of gridded data
Version: 0.11.1
Version: 0.11.2
Date: 2013-05-23
Author: Jordan S Read
Maintainer: Jordan S Read <[email protected]>
Expand Down
1 change: 1 addition & 0 deletions R/check.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ setMethod(f = "check",signature(.Object = "geojob"), definition = function(.Obje
)
if (is.null(checkForComplete)){
process$status <- 'unknown'
process$statusType <- 'unknown'
}
if (is.null(process$status)){
checkForCompleteResponse <- xmlTreeParse(checkForComplete, asText = TRUE,useInternalNodes=TRUE)
Expand Down
12 changes: 8 additions & 4 deletions R/successful.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,19 @@ setMethod(f = "successful",signature(.Object = "geojob"), definition = function(


#'@export
setGeneric(name="running",def=function(.Object){standardGeneric("running")})
setGeneric(name="running",def=function(.Object, ...){standardGeneric("running")})

#'@rdname successful-methods
#'@aliases running
setMethod(f = "running",signature(.Object = "geojob"), definition = function(.Object){
setMethod(f = "running",signature(.Object = "geojob"), definition = function(.Object, retry = FALSE){

status = check(.Object)
process = check(.Object)
if (process$status == 'unknown' && !retry){
Sys.sleep(10)
process = check(.Object)
}

return(status$statusType == "ProcessStarted")
return(process$statusType == "ProcessStarted")
})


Expand Down
4 changes: 2 additions & 2 deletions R/waitUntilFinished.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
#' @keywords internal
#'
waitUntilFinished <- function(.Object, sleep.time = 5){
running <- running(.Object)
running <- running(.Object, retry = TRUE)
while(running){
Sys.sleep(sleep.time)
running <- running(.Object)
running <- running(.Object, retry = TRUE)
}
}
2 changes: 1 addition & 1 deletion man/successful-methods.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ running(.Object)

\S4method{successful}{geojob}(.Object)

\S4method{running}{geojob}(.Object)
\S4method{running}{geojob}(.Object, retry = FALSE)

\S4method{error}{geojob}(.Object)
}
Expand Down
2 changes: 1 addition & 1 deletion man/webprocess-methods.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ webprocess(.Object, ...)
\S4method{webprocess}{ANY}(.Object, ...)
}
\arguments{
\item{.Object}{any object that can be coerced into \linkS4class{webdprocess}}
\item{.Object}{any object that can be coerced into \linkS4class{webprocess}}

\item{...}{additional arguments passed initialize method (e.g., \code{url}, \code{version})}
}
Expand Down

0 comments on commit 992d522

Please sign in to comment.