Fix for race condition during scheduler registration when there are multiple builds on queue