@@ -104,7 +104,7 @@ private List<DSComp> getComponents(final Collection<ComponentDescriptionDTO> des
104
104
.collect (Collectors .toList ());
105
105
} catch (Throwable e ) {
106
106
// exception might occur on shutdown or startup
107
- log .warn ("Exception while getting ds component dtos {}" , e .getMessage (), e );
107
+ log .info ("Exception while getting ds component dtos {}" , e .getMessage (), e );
108
108
return null ;
109
109
}
110
110
}
@@ -128,18 +128,20 @@ public CheckStatus getStatus() {
128
128
watchedComps .stream ().forEach (dsComp -> addDetails (dsComp , details ));
129
129
final CheckStatus .State state = CheckStatus .State .worstOf (watchedComps .stream ().map (this ::status ));
130
130
result = new CheckStatus (getName (), type , state , details .toString ());
131
- } catch (Throwable e ) {
131
+ } catch (final Throwable e ) {
132
132
// exception might occur on shutdown or startup
133
- log .warn ("Exception while checking ds component dtos {}" , e .getMessage (), e );
133
+ log .info ("Exception while checking ds component dtos {}" , e .getMessage (), e );
134
134
result = new CheckStatus (getName (), type , CheckStatus .State .RED , "Exception while checking ds component dtos : " + e .getMessage ());
135
135
}
136
136
}
137
- this .cache .set (result );
137
+ if ( result .getState () == CheckStatus .State .GREEN ) {
138
+ this .cache .set (result );
139
+ }
138
140
}
139
141
return result ;
140
142
}
141
143
142
- private CheckStatus .State status (DSComp component ) {
144
+ private CheckStatus .State status (final DSComp component ) {
143
145
boolean missingConfig = component .config == null && "require" .equals (component .desc .configurationPolicy );
144
146
boolean unsatisfied = !component .unsatisfied .isEmpty ();
145
147
return (missingConfig || unsatisfied ) ? CheckStatus .State .YELLOW : CheckStatus .State .GREEN ;
@@ -150,7 +152,7 @@ private void addDetails(final DSComp component, final StringBuilder details) {
150
152
printer .print (component );
151
153
}
152
154
153
- @ Reference (updated = "updatedServiceComponentRuntime" )
155
+ @ Reference (name = "scr" , updated = "updatedServiceComponentRuntime" )
154
156
private void setServiceComponentRuntime (final ServiceComponentRuntime c ) {
155
157
this .scr = c ;
156
158
}
0 commit comments