File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
spring-cloud-context/src/main/java/org/springframework/cloud/context/restart Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 18
18
19
19
import java .io .Closeable ;
20
20
import java .io .IOException ;
21
+ import java .util .Collections ;
21
22
22
23
import org .apache .commons .logging .Log ;
23
24
import org .apache .commons .logging .LogFactory ;
@@ -86,8 +87,14 @@ public void onApplicationEvent(ApplicationPreparedEvent input) {
86
87
}
87
88
88
89
@ WriteOperation
89
- // FIXME: map with "message: Restarting" or couldn't restart
90
- public Boolean restart () {
90
+ public Object restart () {
91
+ Thread thread = new Thread (this ::safeRestart );
92
+ thread .setDaemon (false );
93
+ thread .start ();
94
+ return Collections .singletonMap ("message" , "Restarting" );
95
+ }
96
+
97
+ private Boolean safeRestart () {
91
98
try {
92
99
doRestart ();
93
100
logger .info ("Restarted" );
You can’t perform that action at this time.
0 commit comments