-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor startup check before running any watch #25
Conversation
try { | ||
buildAdded(b); | ||
} catch (IOException e) { | ||
e.printStackTrace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to log statement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -114,6 +116,28 @@ private void configChange() { | |||
OpenShiftUtils.initializeOpenShiftClient(server); | |||
this.namespace = getNamespaceOrUseDefault(namespace, getOpenShiftClient()); | |||
|
|||
logger.info("Waiting for Jenkins to be started"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering why you need to do this here? Can you not wait until all jobs are loaded? Take a look at this: http://javadoc.jenkins.io/hudson/model/listeners/ItemListener.html#onLoaded()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. TBH I'm not 100% sure that everything is in the right state when ItemListener.onLoaded
is called. The current way may not be the "best" or most correct way to do it but we know it works. I've raised openshift#109 to track it & test it out once I get some time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to keep it the way it is right now & try out the better way you've suggested once time allows. Are you OK with that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me!
No description provided.