Adjust the logic of the dispatcher processes a bit:

For the incremental process notifications, only include the latest output from the process, not the full thing up to that point. Some processes (life preserver, pc-updatemanager) run for a long time and eventually get massive log files.
This commit is contained in:
Ken Moore
2017-08-07 11:52:06 -04:00
parent 34b388277d
commit 6ab7c3dc01
3 changed files with 11 additions and 5 deletions

View File

@@ -105,12 +105,18 @@ void DProcess::cmdFinished(int ret, QProcess::ExitStatus status){
}
void DProcess::updateLog(){
proclog.insert(cCmd, proclog.value(cCmd).toString().append(this->readAllStandardOutput()) );
QString tmp = this->readAllStandardOutput();
lognew.append(tmp);
proclog.insert(cCmd, proclog.value(cCmd).toString().append(tmp) );
if(!uptimer->isActive()){ uptimer->start(); }
}
void DProcess::emitUpdate(){
emit ProcUpdate(ID, proclog);
QJsonObject tmp = proclog;
//only emit the latest changes to the log - not the full thing
tmp.insert(cCmd, lognew );
emit ProcUpdate(ID, tmp);
lognew.clear();
}
// ================================

View File

@@ -35,7 +35,7 @@ public slots:
void startProc();
private:
QString cCmd;
QString cCmd, lognew;
QJsonObject proclog;
QTimer *uptimer;

View File

@@ -423,7 +423,7 @@ void SysMgmt::fetchPortsTree(QStringList &cmds, QStringList &dirs){
cmds.clear(); dirs.clear();
//Does Ports tree exist? If not create it.
if(!QFile::exists("/usr/ports")){
cmds << "mkdir /usr/ports"; dirs << "";
cmds << "mkdir /usr/ports"; dirs << "";
}
//Does a local git repo exist? If not create it.
QString URL = "https://www.github.com/trueos/freebsd-ports.git";
@@ -442,7 +442,7 @@ void SysMgmt::fetchPortsTree(QStringList &cmds, QStringList &dirs){
}
//Now update the tree with git
cmds << "git fetch --depth=1"; dirs << "/usr/ports/.git";
cmds << "git checkout master"; dirs << "/usr/ports";
cmds << "git checkout master"; dirs << "/usr/ports";
}
void SysMgmt::fetchSourceTree(QString branch, QStringList &cmds, QStringList &dirs, QStringList &info){