When writing a custom step that creates a scheduled task, are you 
responsible for calling the "cancel()" method before/after you call 
"onSuccess/onFailure"

I'm getting an error:

completed: already completed CpsStepContext

after my timer has called the onSuccess method, so I assume i'm not doing 
things in the correct order.

Is there a good example of the proper methodology for this? The only 
example i can find is the WaitConditionStep - but that calls a body with 
callback, and so it sets up a net-new timer w/ new runnable instance; not a 
repeated call of the same Runnable.

Right now with this error i'm guessing i should do, these steps *always* in 
this order:

onSuccess/onFailure (depending on state)
task.cancel(true);
task = null;
return;

Am i wrong or missing something?

Thanks in advance!

-Bryan

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/d9f92ef1-0a19-42c5-929c-8499b8020addn%40googlegroups.com.

Reply via email to