.asLongAs(session=>session(“next”).as[String].length()>0)(
exec(doRepoSearch) // executes HTTP get on “session.next”
.foreach("${userFiles}",“file”) {
exec(grabUserFile) //repeated http get on links returned from doRepoSearch
}
.exec(session=> {
println(“Next Link:” + session(“next”).as[String])
val newSession = session.set(“next”,"") //reset to emulate stop condition
newSession
}
)
)//eo asLongAs
but it never hits the final .exec block, it just loops continuously using the original value of “session.next” - i.e. the reset line never gets hit. If I remove the foreach block, the final block gets hit and the loop ends?