var $opts;
var $force = false;
+
+ var $clear_interval = '1 WEEK' // how long to clear the old queue of items.
+
function getAuth()
{
$ff = HTML_FlexyFramework::get();
$this->server->assignQueues($this);
+
+ $this->clearOld('')
+
+
if (!empty($this->evtype)) {
$w->evtype = $this->evtype;
}
$this->domain_queue = false;
return $ret;
}
-
+ function clearOld($interval)
+ {
+ if ($this->server->isFirstServer()) {
+ $p = DB_DataObject::factory($this->table);
+ $p->whereAdd("
+ sent < '2000-01-01'
+ and
+ event_id = 0
+ and
+ act_start < NOW() - INTERVAL {$interval}
+ ");
+ // $p->limit(1000);
+ if ($p->count()) {
+ $ev = $this->addEvent('NOTIFY', false, "RETRY TIME EXCEEDED");
+ $p = DB_DataObject::factory($this->table);
+ $p->query("
+ UPDATE
+ {$this->table}
+ SET
+ sent = NOW(),
+ msgid = '',
+ event_id = {$ev->id}
+ WHERE
+ sent < '2000-01-01'
+ and
+ event_id = 0
+ and
+ act_start < NOW() - INTERVAL 3 DAY
+ LIMIT
+ 1000
+ ");
+
+ }
+ }
+ }
function output()