Adds immediate migration results in progress

This commit is contained in:
torsten committed 2026-08-19 11:18:24 +02:00
1 parent 8453e104c5
commit 3bb6e89496
2102 files changed
+17482 -15071

No files matched your search

@@ -63,19 +63,19 @@ Logger::Logger(LoggerFactory *loggerFactory, QObject *parent)
void Logger::debug(const QString &message)
{
/*DEBUG_LOG*/ERROR_LOG() << message;
/*DEBUG_LOG*/ERROR_LOG(m_logger) << message;
}
void Logger::warning(const QString &message)
{
WARNING_LOG() << message;
WARNING_LOG(m_logger) << message;
}
void Logger::error(const QString &message)
{
ERROR_LOG() << message;
ERROR_LOG(m_logger) << message;
}
@@ -86,7 +86,7 @@ ThpScriptServer::ThpScriptServer(QObject *parent)
{
if (!listen(NGL::Connections::port(NGL::Connections::eConnection::FLM_THP_SERVER)))
{
ERROR_LOG() << "cannot listen on port " << NGL::Connections::port(NGL::Connections::eConnection::FLM_THP_SERVER);
ERROR_LOG(m_logger) << "cannot listen on port " << NGL::Connections::port(NGL::Connections::eConnection::FLM_THP_SERVER);
Q_ASSERT(false);
}
@@ -148,7 +148,7 @@ ThpScriptServer::ThpScriptServer(QObject *parent)
default:
{
ERROR_LOG() << "ws unknown path: " << cli->requestUrl().path();
ERROR_LOG(m_logger) << "ws unknown path: " << cli->requestUrl().path();
failed = true;
break;
}
@@ -192,7 +192,7 @@ const QString ThpScriptServer::readContentFile() const
f->deleteLater();
if (!f->open(QIODevice::ReadOnly))
{
WARNING_LOG() << "Error opening " << f->fileName() << " for reading: " << f->errorString();
WARNING_LOG(m_logger) << "Error opening " << f->fileName() << " for reading: " << f->errorString();
return QStringLiteral("[]");
}
@@ -224,7 +224,7 @@ bool ThpScriptServer::newHttpConnection(httq::HttpRequest *request)
}
catch(const DataStreamError &err)
{
DEBUG_LOG() << "handler threw DataStreamError: " << err.what();
DEBUG_LOG(m_logger) << "handler threw DataStreamError: " << err.what();
// do not delete request as a failed datastream deletes it itself
return false;
}
@@ -304,7 +304,7 @@ ThpServerInformation ThpScriptServer::fromJson(const QJsonValue &val)
void ThpScriptServer::errorHandler(httq::HttpRequest *request, const HttpException &e) const
{
DEBUG_LOG() << "handler threw error: " << e.error << " (http status = " << e.status << ")";
DEBUG_LOG(m_logger) << "handler threw error: " << e.error << " (http status = " << e.status << ")";
QJsonObject root;
@@ -325,7 +325,7 @@ void ThpScriptServer::changeList(const ThpServerInformation &tsi, httq::HttpRequ
QFile contentFile(thpDirectory() + QStringLiteral("content.json"), this);
if (!contentFile.open(QIODevice::ReadWrite))
{
ERROR_LOG() << "Error opening file '" << contentFile.fileName() << "' for read/write: " << contentFile.errorString();
ERROR_LOG(m_logger) << "Error opening file '" << contentFile.fileName() << "' for read/write: " << contentFile.errorString();
throw(HttpException(QStringLiteral("cannot open content file '%1': %2").arg(contentFile.fileName(), contentFile.errorString())));
}
@@ -340,7 +340,7 @@ void ThpScriptServer::changeList(const ThpServerInformation &tsi, httq::HttpRequ
if (err.error != QJsonParseError::NoError)
{
ERROR_LOG() << "content file's json invalid at" << err.offset << ":" << err.errorString();
ERROR_LOG(m_logger) << "content file's json invalid at" << err.offset << ":" << err.errorString();
throw(HttpException(QStringLiteral("content file's json invalid at %1: %2").arg(err.offset).arg(err.errorString())));
}
@@ -368,7 +368,7 @@ void ThpScriptServer::changeList(const ThpServerInformation &tsi, httq::HttpRequ
if (!contentFile.resize(0) || !contentFile.write(QJsonDocument(arr).toJson()))
{
ERROR_LOG() << "Error writing content.json: " << contentFile.errorString();
ERROR_LOG(m_logger) << "Error writing content.json: " << contentFile.errorString();
throw(HttpException(QStringLiteral("error writing content file: %1").arg(contentFile.errorString())));
}
@@ -534,7 +534,7 @@ bool ThpScriptServer::handleRequestSync(httq::HttpRequest &request) noexcept(fal
default:
{
WARNING_LOG() << "unsupported method for /thp2";
WARNING_LOG(m_logger) << "unsupported method for /thp2";
throw HttpException(L("unsupported method for /thp2: %1").arg((int)request.method()), 405);
}
}
@@ -624,7 +624,7 @@ bool ThpScriptServer::handleRequest(httq::HttpRequest *request) noexcept(false)
if (!QFile::remove(destFile))
{
const QString err(QStringLiteral("Cannot remove old THP upload file %1 - removing THP not possible").arg(destFile));
ERROR_LOG() << err;
ERROR_LOG(m_logger) << err;
throw(HttpException(err));
}
@@ -663,7 +663,7 @@ bool ThpScriptServer::handleRequest(httq::HttpRequest *request) noexcept(false)
if (!QDir().mkpath(destDir))
{
const QString err(QStringLiteral("Cannot create directory %1 - THP upload not possible").arg(destDir));
ERROR_LOG() << err;
ERROR_LOG(m_logger) << err;
throw(HttpException(err));
}
@@ -672,7 +672,7 @@ bool ThpScriptServer::handleRequest(httq::HttpRequest *request) noexcept(false)
if (fi.exists() && !QFile::remove(destFile))
{
const QString err(QStringLiteral("Cannot remove old THP upload file %1 - THP upload not possible").arg(destDir));
ERROR_LOG() << err;
ERROR_LOG(m_logger) << err;
throw(HttpException(err));
}
@@ -701,7 +701,7 @@ bool ThpScriptServer::handleRequest(httq::HttpRequest *request) noexcept(false)
if (!d.exists() && !d.mkpath(destDir))
{
const QString errstr(QStringLiteral("Can create directory '%1' - THP upload not possible").arg(destDir));
ERROR_LOG() << errstr;
ERROR_LOG(m_logger) << errstr;
throw(HttpException(errstr));
}
@@ -710,7 +710,7 @@ bool ThpScriptServer::handleRequest(httq::HttpRequest *request) noexcept(false)
if (fi.exists() && !QFile::remove(destFile))
{
const QString errstr(QStringLiteral("Can not remove old file '%1'").arg(destDir));
ERROR_LOG() << errstr;
ERROR_LOG(m_logger) << errstr;
throw(HttpException(errstr));
}
@@ -719,7 +719,7 @@ bool ThpScriptServer::handleRequest(httq::HttpRequest *request) noexcept(false)
if (!f->rename(destFile))
{
const QString errstr(QStringLiteral("Can not rename %1 to %2: %3").arg(tmpFilename, destFile, f->errorString()));
ERROR_LOG() << errstr;
ERROR_LOG(m_logger) << errstr;
throw(HttpException(errstr));
}
@@ -743,7 +743,7 @@ bool ThpScriptServer::handleRequest(httq::HttpRequest *request) noexcept(false)
default:
{
WARNING_LOG() << "unsupported method";
WARNING_LOG(m_logger) << "unsupported method";
throw(HttpException(QStringLiteral("unsupported method"), 405));
}
}