mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 02:20:17 +00:00
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:
@@ -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();
|
||||
}
|
||||
|
||||
// ================================
|
||||
|
||||
@@ -35,7 +35,7 @@ public slots:
|
||||
void startProc();
|
||||
|
||||
private:
|
||||
QString cCmd;
|
||||
QString cCmd, lognew;
|
||||
QJsonObject proclog;
|
||||
QTimer *uptimer;
|
||||
|
||||
|
||||
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user