mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-11 09:03:40 +02:00
2014-10-07 Fred Gleason <fredg@paravelsystems.com>
* Added a 'GPIO_EVENTS' table to the database. * Incremented the database version to 240. * Implemented GPIO event logging in 'ripcd/local_macros.cpp' and 'ripcd/ripcd.h'. * Added an 'Events Log' area to RDGpiMon(1) in 'utils/rdgpimon/rdgpimon.cpp' and 'utils/rdgpimon/rdgpimon.h'. * Added code in rdmaint(1) to purge logged GPIO events in 'utils/rdmaint/rdmaint.cpp' and 'utils/rdmaint/rdmaint.h'.
This commit is contained in:
@@ -132,6 +132,7 @@ void MainObject::RunSystemMaintenance()
|
||||
PurgeCuts();
|
||||
PurgeLogs();
|
||||
PurgeElr();
|
||||
PurgeGpioEvents();
|
||||
sql="update VERSION set LAST_MAINT_DATETIME=now()";
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
@@ -268,6 +269,19 @@ void MainObject::PurgeDropboxes()
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
void MainObject::PurgeGpioEvents()
|
||||
{
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
|
||||
sql=QString("delete from GPIO_EVENTS where ")+
|
||||
"EVENT_DATETIME<\""+
|
||||
QDate::currentDate().addDays(-30).toString("yyyy-MM-dd")+" 00:00:00\"";
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
int main(int argc,char *argv[])
|
||||
{
|
||||
|
@@ -47,6 +47,7 @@ class MainObject : public QObject
|
||||
void PurgeLogs();
|
||||
void PurgeElr();
|
||||
void PurgeDropboxes();
|
||||
void PurgeGpioEvents();
|
||||
RDConfig *maint_config;
|
||||
bool maint_verbose;
|
||||
bool maint_system;
|
||||
|
Reference in New Issue
Block a user