I think for this it might be worth excluding builds with STATUS_RUNNING and STATUS_NEW ? What do you think? To me it seems this is most useful for clearing away old builds. I don't think you'd want to get rid of anything actually running.