mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-18 19:41:30 +00:00
[Cleanup] Move variable definition to more relevant scope in DatabaseDumpService::Dump() (#3200)
# Notes - This was unused except for in this one spot, move to scope of condition where it's used. - https://pvs-studio.com/en/docs/warnings/v821/
This commit is contained in:
parent
d142bc552a
commit
c6bb0f6495
@ -295,14 +295,6 @@ void DatabaseDumpService::DatabaseDump()
|
|||||||
pipe_file = fmt::format(" > {}.sql", GetDumpFileNameWithPath());
|
pipe_file = fmt::format(" > {}.sql", GetDumpFileNameWithPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string execute_command = fmt::format(
|
|
||||||
"{} {} {} {}",
|
|
||||||
GetBaseMySQLDumpCommand(),
|
|
||||||
options,
|
|
||||||
tables_to_dump,
|
|
||||||
pipe_file
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!File::Exists(GetSetDumpPath()) && !IsDumpOutputToConsole()) {
|
if (!File::Exists(GetSetDumpPath()) && !IsDumpOutputToConsole()) {
|
||||||
File::Makedir(GetSetDumpPath());
|
File::Makedir(GetSetDumpPath());
|
||||||
}
|
}
|
||||||
@ -319,6 +311,14 @@ void DatabaseDumpService::DatabaseDump()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
const auto execute_command = fmt::format(
|
||||||
|
"{} {} {} {}",
|
||||||
|
GetBaseMySQLDumpCommand(),
|
||||||
|
options,
|
||||||
|
tables_to_dump,
|
||||||
|
pipe_file
|
||||||
|
);
|
||||||
|
|
||||||
std::string execution_result = Process::execute(execute_command);
|
std::string execution_result = Process::execute(execute_command);
|
||||||
if (!execution_result.empty() && IsDumpOutputToConsole()) {
|
if (!execution_result.empty() && IsDumpOutputToConsole()) {
|
||||||
std::cout << execution_result;
|
std::cout << execution_result;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user