Without relying on plugins, I'd make sure there's a longer quiet period for the 
job so you can cleanly cancel the build while still in the queue.

Other than that, there's an extension point -- Queue.QueueDecisionHandler -- 
that plugins can implement to deny queueing of a build. It should be fairly 
easy to implement a plugin that can optionally prevent build scheduling if a 
build was started within the last x hours or so. As far as existing plugins, I 
only know of Skip Next Build Plugin, which is part of the commercial Jenkins 
Enterprise by Cloudbees.

On 06.01.2015, at 22:38, Mark Sinclair <[email protected]> wrote:

> All my jobs run on a schedule, typically once per day.  
> 
> Sometimes a bug is found and we initiate an immediate build at some point 
> during the day.  I'm interested in cancelling the next timer based build when 
> the user has initiated a build within a certain time period.  This saves some 
> compute resources by avoiding running the job twice in a day.
> 
> What is the cleanest way to do this?  Ideally, I want Jenkins to not schedule 
> the next build.  Once the build starts, aborting it based on checking 
> previous build start time does not seem pretty.
> 
> Thanks!
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Jenkins Users" 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-users/44f05d86-00b2-4ef2-9e46-9bce317c6e81%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" 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-users/D4EE56B0-1745-473E-B947-016C794E484F%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to