Finish of changes for 0.4, unique non POSIX signal handling for nginx and php-fpm added
Some checks failed
Build & Upload tux-dock / build (push) Has been cancelled
Some checks failed
Build & Upload tux-dock / build (push) Has been cancelled
This commit is contained in:
parent
2557419d4d
commit
f568624956
6 changed files with 293 additions and 43 deletions
8
main.cpp
8
main.cpp
|
|
@ -649,18 +649,18 @@ void TuxDockApp::ActionStopContainer() {
|
|||
OpenInput(
|
||||
"Stop Container",
|
||||
"Shutdown grace period in seconds for " + name +
|
||||
" (default 10, max " + std::to_string(kMaxStopTimeout) + "):",
|
||||
" (default 60, max " + std::to_string(kMaxStopTimeout) + "):",
|
||||
[this, id](bool ok, const std::string& value) {
|
||||
if (!ok) return;
|
||||
int seconds = 10;
|
||||
int seconds = 60;
|
||||
if (!value.empty()) {
|
||||
try {
|
||||
seconds = std::stoi(value);
|
||||
} catch (...) {
|
||||
seconds = 10;
|
||||
seconds = 60;
|
||||
}
|
||||
}
|
||||
if (seconds < 0) seconds = 10;
|
||||
if (seconds < 0) seconds = 60;
|
||||
if (seconds > kMaxStopTimeout) seconds = kMaxStopTimeout;
|
||||
BeginStopOperation(id, seconds);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue