Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+2
@@ -63,6 +63,8 @@ public:
|
||||
bool txData(const TrainingAreaBase::TetraIcd::ExConfirmationReport &data) override;
|
||||
|
||||
protected:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
template <typename T>
|
||||
bool sendToTx(const T *data);
|
||||
protected:
|
||||
|
||||
+9
-10
@@ -19,12 +19,11 @@ namespace TetraRadio
|
||||
|
||||
|
||||
|
||||
DirectoryCleaner::DirectoryCleaner(const QString &directory, unsigned int maxAgeSec, QObject *parent)
|
||||
: QObject(parent)
|
||||
DirectoryCleaner::DirectoryCleaner(const QString &directory, unsigned int maxAgeSec, QObject *parent) : QObject(parent)
|
||||
, m_cleanerThread(new QThread(this))
|
||||
, m_worker(new DirectoryCleanerWorker(directory, maxAgeSec))
|
||||
.getNGLLogger("TAB.Plugin.DirectoryCleaner"))
|
||||
{
|
||||
.getNGLLogger("TAB.Plugin.DirectoryCleaner")),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
QDir().mkpath(directory);
|
||||
doInitialCleanup(directory);
|
||||
m_worker->moveToThread(m_cleanerThread);
|
||||
@@ -44,7 +43,7 @@ void DirectoryCleaner::doInitialCleanup(const QString &directory)
|
||||
QDir d(directory);
|
||||
if (!d.exists())
|
||||
{
|
||||
WARNING_LOG() << "Directory " << directory
|
||||
WARNING_LOG(m_logger) << "Directory " << directory
|
||||
<< " does not exist - can not cleanup directory";
|
||||
return;
|
||||
}
|
||||
@@ -113,7 +112,7 @@ void DirectoryCleanerWorker::doCleanup()
|
||||
if (!d.exists())
|
||||
{
|
||||
if (!m_bWarnedOnce)
|
||||
WARNING_LOG() << "Directory " << m_directory
|
||||
WARNING_LOG(m_logger) << "Directory " << m_directory
|
||||
<< " does not exist - can not cleanup directory";
|
||||
m_bWarnedOnce = true;
|
||||
return;
|
||||
@@ -127,12 +126,12 @@ void DirectoryCleanerWorker::doCleanup()
|
||||
const QString filename(it.fileName());
|
||||
bool bOk = false;
|
||||
qint64 timestampUSec = filename.toLongLong(&bOk);
|
||||
TRACE_LOG() << "File: " << filename
|
||||
TRACE_LOG(m_logger) << "File: " << filename
|
||||
<< " timestamp: " << timestampUSec
|
||||
<< " remove time: " << tRemoveTimeMSec * 1000;
|
||||
if (!bOk)
|
||||
{
|
||||
WARNING_LOG() << "Found file with name '" << filepath
|
||||
WARNING_LOG(m_logger) << "Found file with name '" << filepath
|
||||
<< " which is not a valid xdr filename"
|
||||
<< " - removing this file when mtime older than "
|
||||
<< m_maxAgeSec << "seconds";
|
||||
@@ -146,9 +145,9 @@ void DirectoryCleanerWorker::doCleanup()
|
||||
if (timestampMSec < tRemoveTimeMSec)
|
||||
{
|
||||
if (!QFile::remove(filepath))
|
||||
WARNING_LOG() << "Could not remove " << filepath;
|
||||
WARNING_LOG(m_logger) << "Could not remove " << filepath;
|
||||
else
|
||||
TRACE_LOG() << "Removed " << filepath;
|
||||
TRACE_LOG(m_logger) << "Removed " << filepath;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
@@ -19,6 +19,7 @@ public:
|
||||
private:
|
||||
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
void doInitialCleanup(const QString &directory);
|
||||
bool teleShouldBeRemoved(int teleId);
|
||||
QThread *m_cleanerThread;
|
||||
@@ -34,8 +35,10 @@ public:
|
||||
public Q_SLOTS:
|
||||
void onTimeout();
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void doCleanup();
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QString m_directory;
|
||||
qint64 m_maxAgeSec;
|
||||
bool m_bWarnedOnce;
|
||||
|
||||
Reference in new issue
Block a user