This repository was archived by the owner on Oct 12, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -213,12 +213,35 @@ waitForTasksToComplete <-
213213 totalTasks <- totalTasks + length(currentTasks $ value )
214214 }
215215
216- pb <- txtProgressBar(min = 0 , max = totalTasks , style = 3 )
217216 timeToTimeout <- Sys.time() + timeout
218217
219218 repeat {
220219 taskCounts <- rAzureBatch :: getJobTaskCounts(jobId )
221- setTxtProgressBar(pb , taskCounts $ completed )
220+ progressBarValue <- round(taskCounts $ completed / totalTasks * getOption(" width" ))
221+
222+ if (taskCounts $ completed == totalTasks - 1 ) {
223+ status <- " Tasks have completed. Merging results"
224+ }
225+ else {
226+ status <- " "
227+ }
228+
229+ outputProgressBar <- sprintf(" |%s%s|" ,
230+ strrep(" =" , progressBarValue ),
231+ strrep(" " , getOption(" width" ) - progressBarValue ))
232+ outputTaskCount <- sprintf(" %s (%s/%s)" ,
233+ sprintf(" %.2f%%" , (taskCounts $ completed / totalTasks ) * 100 ),
234+ taskCounts $ completed ,
235+ totalTasks )
236+ outputTaskCount <- sprintf(" %s %s" ,
237+ outputTaskCount ,
238+ strrep(" " , getOption(" width" ) - nchar(as.character(outputTaskCount ))))
239+
240+ cat(' \r ' , sprintf(" %s %s %s" ,
241+ outputProgressBar ,
242+ outputTaskCount ,
243+ status ))
244+ flush.console()
222245
223246 validationFlag <-
224247 (taskCounts $ validationStatus == " Validated" &&
You can’t perform that action at this time.
0 commit comments