mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
Merge pull request #187 from YACReader/feature/fix-server-start-up-sequence
Fix launch sequence to avoid http port collisions
This commit is contained in:
commit
350234b099
@ -29,7 +29,7 @@
|
||||
|
||||
#define PICTUREFLOW_QT4 1
|
||||
|
||||
//interfaz al servidor
|
||||
//Server interface
|
||||
Startup *s;
|
||||
|
||||
using namespace QsLogging;
|
||||
@ -215,8 +215,23 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
QLOG_INFO() << "YACReaderLibrary attempting to start";
|
||||
|
||||
logSystemAndConfig();
|
||||
|
||||
if (YACReaderLocalServer::isRunning()) //only a single instance of YACReaderLibrary is allowed
|
||||
{
|
||||
QLOG_WARN() << "another instance of YACReaderLibrary is running";
|
||||
#ifdef Q_OS_WIN
|
||||
logger.shutDownLoggerThread();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
QLOG_INFO() << "YACReaderLibrary starting";
|
||||
|
||||
#ifdef SERVER_RELEASE
|
||||
QSettings *settings = new QSettings(YACReader::getSettingsPath() + "/YACReaderLibrary.ini", QSettings::IniFormat); //TODO unificar la creaci<63>n del fichero de config con el servidor
|
||||
QSettings *settings = new QSettings(YACReader::getSettingsPath() + "/YACReaderLibrary.ini", QSettings::IniFormat);
|
||||
settings->beginGroup("libraryConfig");
|
||||
|
||||
s = new Startup();
|
||||
@ -225,19 +240,6 @@ int main(int argc, char **argv)
|
||||
s->start();
|
||||
}
|
||||
#endif
|
||||
QLOG_INFO() << "YACReaderLibrary attempting to start";
|
||||
|
||||
logSystemAndConfig();
|
||||
|
||||
if (YACReaderLocalServer::isRunning()) //s<>lo se permite una instancia de YACReaderLibrary
|
||||
{
|
||||
QLOG_WARN() << "another instance of YACReaderLibrary is running";
|
||||
#ifdef Q_OS_WIN
|
||||
logger.shutDownLoggerThread();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
QLOG_INFO() << "YACReaderLibrary starting";
|
||||
|
||||
auto localServer = new YACReaderLocalServer();
|
||||
|
||||
|
@ -175,6 +175,21 @@ int main(int argc, char **argv)
|
||||
|
||||
qRegisterMetaType<ComicDB>("ComicDB");
|
||||
|
||||
QLOG_INFO() << "YACReaderLibraryServer attempting to start";
|
||||
|
||||
logSystemAndConfig();
|
||||
|
||||
if (YACReaderLocalServer::isRunning()) // allow one server instance
|
||||
{
|
||||
QLOG_WARN() << "another instance of YACReaderLibrary is running";
|
||||
#ifdef Q_OS_WIN
|
||||
logger.shutDownLoggerThread();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
QLOG_INFO() << "YACReaderLibrary starting";
|
||||
|
||||
QSettings *settings = new QSettings(YACReader::getSettingsPath() + "/" + QCoreApplication::applicationName() + ".ini", QSettings::IniFormat);
|
||||
settings->beginGroup("libraryConfig");
|
||||
|
||||
@ -195,22 +210,9 @@ int main(int argc, char **argv)
|
||||
s->start();
|
||||
}
|
||||
|
||||
QLOG_INFO() << "YACReaderLibraryServer attempting to start";
|
||||
|
||||
logSystemAndConfig();
|
||||
|
||||
if (YACReaderLocalServer::isRunning()) // allow one server instance
|
||||
{
|
||||
QLOG_WARN() << "another instance of YACReaderLibrary is running";
|
||||
#ifdef Q_OS_WIN
|
||||
logger.shutDownLoggerThread();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
QLOG_INFO() << "YACReaderLibrary starting";
|
||||
QLOG_INFO() << "Running on port" << s->getPort();
|
||||
|
||||
//Update libraries to now versions
|
||||
//Update libraries to new versions
|
||||
LibrariesUpdater updater;
|
||||
updater.updateIfNeeded();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user