Mentioned as possible cleanup in #455, the weight of each factor is checked every time the priority of a job is calculated. It would be cleaner to put this check somewhere else so it does not need to be repeated for every job.
This PR creates defaults for the weights of each factor used in the priority calculation of a job and initializes each weight when the plugin is first loaded. In the callback for conf.update, it then checks to see if these weights have been configured; if not, it will just continue to use the defaults defined at the top of the file.
Problem
Mentioned as possible cleanup in #455, the weight of each factor is checked every time the priority of a job is calculated. It would be cleaner to put this check somewhere else so it does not need to be repeated for every job.
This PR creates defaults for the weights of each factor used in the priority calculation of a job and initializes each weight when the plugin is first loaded. In the callback for
conf.update
, it then checks to see if these weights have been configured; if not, it will just continue to use the defaults defined at the top of the file.