Check for automatic update and add a hint in SEND-LAST-MESSAGE.
This commit is contained in:
parent
41392a98e3
commit
6b3ebde2b5
@ -270,12 +270,14 @@ void Worker::privateUpdate() {
|
|||||||
m_ismasTriggerActive = false;
|
m_ismasTriggerActive = false;
|
||||||
m_updateNotNecessary = false;
|
m_updateNotNecessary = false;
|
||||||
|
|
||||||
|
QDateTime const ¤t = QDateTime::currentDateTime();
|
||||||
|
m_automaticUpdate = (current.time().hour() < 4);
|
||||||
|
|
||||||
m_ismasTriggerActive = updateTriggerSet();
|
m_ismasTriggerActive = updateTriggerSet();
|
||||||
if (m_ismasTriggerActive == false) {
|
if (m_ismasTriggerActive == false) {
|
||||||
if (QDir(m_customerRepository).exists()) { // ignore a possibly corrupted repository
|
if (QDir(m_customerRepository).exists()) { // ignore a possibly corrupted repository
|
||||||
m_versionInfo = m_gc.gitShowReason(m_branchName);
|
m_versionInfo = m_gc.gitShowReason(m_branchName);
|
||||||
QDateTime const ¤t = QDateTime::currentDateTime();
|
if (m_automaticUpdate) { // update has been triggered within [00:00:00, 00:03:59]
|
||||||
if (current.time().hour() < 4) { // update has been triggered within [00:00:00, 00:03:59]
|
|
||||||
m_updateNotNecessary = true;
|
m_updateNotNecessary = true;
|
||||||
m_ismasTriggerStatusMessage = QStringList(QString("NO UPDATE NECESSARY (%1)").arg(current.toString(Qt::ISODate)));
|
m_ismasTriggerStatusMessage = QStringList(QString("NO UPDATE NECESSARY (%1)").arg(current.toString(Qt::ISODate)));
|
||||||
m_lastFailedUpdateStep = UPDATE_STEP::NONE;
|
m_lastFailedUpdateStep = UPDATE_STEP::NONE;
|
||||||
|
11
worker.h
11
worker.h
@ -160,6 +160,7 @@ class Worker : public QThread{
|
|||||||
bool m_repairClone = false;
|
bool m_repairClone = false;
|
||||||
bool m_ismasTriggerActive = false;
|
bool m_ismasTriggerActive = false;
|
||||||
bool m_updateNotNecessary = false;
|
bool m_updateNotNecessary = false;
|
||||||
|
bool m_automaticUpdate = false;
|
||||||
QStringList m_ismasTriggerStatusMessage;
|
QStringList m_ismasTriggerStatusMessage;
|
||||||
|
|
||||||
MainWindow *m_mainWindow;
|
MainWindow *m_mainWindow;
|
||||||
@ -207,7 +208,6 @@ class Worker : public QThread{
|
|||||||
|
|
||||||
if (m_worker->m_lastFailedUpdateStep == UPDATE_STEP::NONE) {
|
if (m_worker->m_lastFailedUpdateStep == UPDATE_STEP::NONE) {
|
||||||
if (m_worker->m_updateNotNecessary) {
|
if (m_worker->m_updateNotNecessary) {
|
||||||
// m_ismasTriggerStatusMessage = QStringList(QString("NO UPDATE NECESSARY (%1)").arg(current.toString(Qt::ISODate)));
|
|
||||||
QStringList lst = m_worker->m_ismasTriggerStatusMessage;
|
QStringList lst = m_worker->m_ismasTriggerStatusMessage;
|
||||||
m_worker->GUI(lst) << (m_worker->CONSOLE(lst) << (m_worker->ISMAS(lst) << UPDATE_STEP::UPDATE_NOT_NECESSARY));
|
m_worker->GUI(lst) << (m_worker->CONSOLE(lst) << (m_worker->ISMAS(lst) << UPDATE_STEP::UPDATE_NOT_NECESSARY));
|
||||||
} else {
|
} else {
|
||||||
@ -229,8 +229,17 @@ class Worker : public QThread{
|
|||||||
m_worker->GUI(lst) << (m_worker->CONSOLE(lst) << (m_worker->ISMAS(lst) << UPDATE_STEP::UPDATE_FAILED));
|
m_worker->GUI(lst) << (m_worker->CONSOLE(lst) << (m_worker->ISMAS(lst) << UPDATE_STEP::UPDATE_FAILED));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_worker->m_automaticUpdate) {
|
||||||
|
QStringList lst = (QStringList() << "AUTOMATIC UPDATE");
|
||||||
|
if (m_worker->m_updateNotNecessary) {
|
||||||
|
lst << "UPDATE NOT NECESSARY";
|
||||||
|
}
|
||||||
|
m_worker->ISMAS(lst) << (m_worker->GUI(lst) << (m_worker->CONSOLE(lst)
|
||||||
|
<< UPDATE_STEP::SEND_LAST_VERSION));
|
||||||
|
} else {
|
||||||
m_worker->ISMAS() << (m_worker->GUI() << (m_worker->CONSOLE()
|
m_worker->ISMAS() << (m_worker->GUI() << (m_worker->CONSOLE()
|
||||||
<< UPDATE_STEP::SEND_LAST_VERSION));
|
<< UPDATE_STEP::SEND_LAST_VERSION));
|
||||||
|
}
|
||||||
m_worker->stopProgressLoop();
|
m_worker->stopProgressLoop();
|
||||||
|
|
||||||
m_worker->m_updateProcessRunning = false;
|
m_worker->m_updateProcessRunning = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user