Like this?:

    val disableJob = disableAfterFailures > 0 && (job.errorsSinceLastSuccess + 1 >= disableAfterFailures)