Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
d50d378c
Commit
d50d378c
authored
Dec 23, 2013
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent more than one app at a time from running
parent
0bca416d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
RunCommand.java
...java/org/springframework/boot/cli/command/RunCommand.java
+15
-2
No files found.
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/RunCommand.java
View file @
d50d378c
...
@@ -53,7 +53,7 @@ public class RunCommand extends OptionParsingCommand {
...
@@ -53,7 +53,7 @@ public class RunCommand extends OptionParsingCommand {
public
void
stop
()
{
public
void
stop
()
{
if
(
this
.
getHandler
()
!=
null
)
{
if
(
this
.
getHandler
()
!=
null
)
{
((
RunOptionHandler
)
this
.
getHandler
()).
runner
.
stop
();
((
RunOptionHandler
)
this
.
getHandler
()).
stop
();
}
}
}
}
...
@@ -78,8 +78,21 @@ public class RunCommand extends OptionParsingCommand {
...
@@ -78,8 +78,21 @@ public class RunCommand extends OptionParsingCommand {
this
.
quietOption
=
option
(
asList
(
"quiet"
,
"q"
),
"Quiet logging"
);
this
.
quietOption
=
option
(
asList
(
"quiet"
,
"q"
),
"Quiet logging"
);
}
}
public
synchronized
void
stop
()
{
if
(
this
.
runner
!=
null
)
{
this
.
runner
.
stop
();
}
this
.
runner
=
null
;
}
@Override
@Override
protected
void
run
(
OptionSet
options
)
throws
Exception
{
protected
synchronized
void
run
(
OptionSet
options
)
throws
Exception
{
if
(
this
.
runner
!=
null
)
{
throw
new
RuntimeException
(
"Already running. Please stop the current application before running another."
);
}
FileOptions
fileOptions
=
new
FileOptions
(
options
);
FileOptions
fileOptions
=
new
FileOptions
(
options
);
if
(
options
.
has
(
this
.
editOption
))
{
if
(
options
.
has
(
this
.
editOption
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment