Code Refactoring

Modified comments. Organized imports.
This commit is contained in:
balandi1 2019-11-26 14:24:20 -05:00
parent 2fa3bebaa6
commit 0c0361e209
24 changed files with 114 additions and 105 deletions

View file

@ -90,13 +90,13 @@ func UpdateEnvironment(offer *mesos.Offer) {
var host = offer.GetHostname()
// If this host is not present in the set of hosts.
if _, ok := constants.Hosts[host]; !ok {
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE, log.InfoLevel,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE, log.InfoLevel,
log.Fields{"Adding host": host}, "New host detected")
// Add this host.
constants.Hosts[host] = struct{}{}
// Get the power class of this host.
class := PowerClass(offer)
elekLog.ElektronLog.Log(elekLogTypes.CONSOLE, log.InfoLevel,
elekLog.ElektronLogger.Log(elekLogTypes.CONSOLE, log.InfoLevel,
log.Fields{"host": host, "PowerClass": class}, "Registering the power class...")
// If new power class, register the power class.
if _, ok := constants.PowerClasses[class]; !ok {