mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -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
|
#define PICTUREFLOW_QT4 1
|
||||||
|
|
||||||
//interfaz al servidor
|
//Server interface
|
||||||
Startup *s;
|
Startup *s;
|
||||||
|
|
||||||
using namespace QsLogging;
|
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
|
#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");
|
settings->beginGroup("libraryConfig");
|
||||||
|
|
||||||
s = new Startup();
|
s = new Startup();
|
||||||
@ -225,19 +240,6 @@ int main(int argc, char **argv)
|
|||||||
s->start();
|
s->start();
|
||||||
}
|
}
|
||||||
#endif
|
#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();
|
auto localServer = new YACReaderLocalServer();
|
||||||
|
|
||||||
|
@ -175,6 +175,21 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
qRegisterMetaType<ComicDB>("ComicDB");
|
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);
|
QSettings *settings = new QSettings(YACReader::getSettingsPath() + "/" + QCoreApplication::applicationName() + ".ini", QSettings::IniFormat);
|
||||||
settings->beginGroup("libraryConfig");
|
settings->beginGroup("libraryConfig");
|
||||||
|
|
||||||
@ -195,22 +210,9 @@ int main(int argc, char **argv)
|
|||||||
s->start();
|
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();
|
QLOG_INFO() << "Running on port" << s->getPort();
|
||||||
|
|
||||||
//Update libraries to now versions
|
//Update libraries to new versions
|
||||||
LibrariesUpdater updater;
|
LibrariesUpdater updater;
|
||||||
updater.updateIfNeeded();
|
updater.updateIfNeeded();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user