startBuildAndMonitorItsProgress().then(
function buildFinishedSuccessfully() {
}, function buildFailed() {
});
It seems that I can accomplish it by doing nestor.buildJob, followed by setInterval(nestor.readLatestJob) and reading response.result and response.timestamp and then:
if response.timestamp < myTimestampWhenQueueingTheJob I am getting info about previously completed job so I discard it (and the thing I asked for is still in the queue)
else check if response.result !== null then my build is finished, so I call the callback / resolve the promise
but it all seems very hacky
Do you think there's a better way?
Thanks!
Edit: found job.checkStarted which will simplify things a bit
Hello, my use case is basically like this:
It seems that I can accomplish it by doing
nestor.buildJob
, followed bysetInterval(nestor.readLatestJob)
and readingresponse.result
andresponse.timestamp
and then:if
response.timestamp < myTimestampWhenQueueingTheJob
I am getting info about previously completed job so I discard it (and the thing I asked for is still in the queue) else check ifresponse.result !== null
then my build is finished, so I call the callback / resolve the promisebut it all seems very hacky
Do you think there's a better way?
Thanks!
Edit: found
job.checkStarted
which will simplify things a bit