mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-28 06:32:32 +02:00
2023-05-16 Fred Gleason <fredg@paravelsystems.com>
* Refactored rdrssd(8) to process feeds at two seconds after each minute. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
4adc7fa066
commit
91531f6baa
@ -24105,3 +24105,6 @@
|
||||
values on the 'Editing Item' dialog in rdcastmanager(1).
|
||||
2023-05-16 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added a usage note to 'apis/cdn/scripts/akamai_purge.cdn'.
|
||||
2023-05-16 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Refactored rdrssd(8) to process feeds at two seconds after each
|
||||
minute.
|
||||
|
@ -34,11 +34,8 @@ MainObject::MainObject(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
QString err_msg;
|
||||
bool ok=false;
|
||||
RDApplication::ErrorType err_type=RDApplication::ErrorOk;
|
||||
|
||||
d_process_interval=RDRSSD_DEFAULT_PROCESS_INTERVAL;
|
||||
|
||||
//
|
||||
// Open the Database
|
||||
//
|
||||
@ -68,15 +65,6 @@ MainObject::MainObject(QObject *parent)
|
||||
// Read Command Options
|
||||
//
|
||||
for(unsigned i=0;i<rda->cmdSwitch()->keys();i++) {
|
||||
if(rda->cmdSwitch()->key(i)=="--process-interval") {
|
||||
d_process_interval=1000*rda->cmdSwitch()->value(i).toInt(&ok);
|
||||
if((!ok)||(d_process_interval<=0)) {
|
||||
fprintf(stderr,
|
||||
"rdrssd: invalid value specified for --process-interval\n");
|
||||
exit(1);
|
||||
}
|
||||
rda->cmdSwitch()->setProcessed(i,true);
|
||||
}
|
||||
if(!rda->cmdSwitch()->processed(i)) {
|
||||
rda->syslog(LOG_ERR,"unknown command option \"%s\"",
|
||||
(const char *)rda->cmdSwitch()->key(i).toUtf8());
|
||||
@ -96,7 +84,8 @@ MainObject::MainObject(QObject *parent)
|
||||
d_timer=new QTimer(this);
|
||||
d_timer->setSingleShot(true);
|
||||
connect(d_timer,SIGNAL(timeout()),this,SLOT(timeoutData()));
|
||||
d_timer->start(0);
|
||||
|
||||
StartTimer();
|
||||
|
||||
rda->syslog(LOG_DEBUG,"started");
|
||||
}
|
||||
@ -117,7 +106,17 @@ void MainObject::timeoutData()
|
||||
}
|
||||
delete q;
|
||||
|
||||
d_timer->start(d_process_interval);
|
||||
StartTimer();
|
||||
}
|
||||
|
||||
|
||||
void MainObject::StartTimer()
|
||||
{
|
||||
QDateTime now=QDateTime::currentDateTime();
|
||||
QDateTime then=now.addSecs(60);
|
||||
|
||||
then.setTime(QTime(then.time().hour(),then.time().minute(),2));
|
||||
d_timer->start(now.msecsTo(then));
|
||||
}
|
||||
|
||||
|
||||
|
@ -24,8 +24,7 @@
|
||||
#include <QObject>
|
||||
#include <QTimer>
|
||||
|
||||
#define RDRSSD_DEFAULT_PROCESS_INTERVAL 60000
|
||||
#define RDRSSD_USAGE "[--process-interval=<secs>]\n\n"
|
||||
#define RDRSSD_USAGE "\n"
|
||||
|
||||
class MainObject : public QObject
|
||||
{
|
||||
@ -37,8 +36,8 @@ class MainObject : public QObject
|
||||
void timeoutData();
|
||||
|
||||
private:
|
||||
void StartTimer();
|
||||
void ProcessFeed(const QString &key_name);
|
||||
int d_process_interval;
|
||||
QTimer *d_timer;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user