Skip to content

Commit

Permalink
Add debug logging for functions registration
Browse files Browse the repository at this point in the history
Logging addition might help track what is being registered. Borrowed
from a pending change Iecd48f992896a31139a8366e1b686dc4e12ef1cc
on OpenDev ( https://review.opendev.org/c/x/gearman-plugin/+/423337 ).
  • Loading branch information
Karpenko Oleksandr authored and hashar committed May 11, 2021
1 parent da9af33 commit b51451e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,13 @@ public void registerJobs() {
}
}
}
logger.debug("---- Worker "+ getName() +" registerJobs try to register " + newFunctionMap.size() + " function(s)");
if (!newFunctionMap.keySet().equals(functionMap.keySet())) {
functionMap = newFunctionMap;
Set<GearmanFunctionFactory> functionSet = new HashSet<GearmanFunctionFactory>(functionMap.values());
updateJobs(functionSet);
} else {
logger.debug("---- Worker "+ getName() +" registerJobs no changes");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public void registerJobs(){

updateJobs(functionSet);
registered = true;
logger.debug("---- Worker "+ getName() +" registerJobs registered " + functionSet.size() + " function(s)");
}
}
}

0 comments on commit b51451e

Please sign in to comment.