mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 06:10:12 +01:00
fixed the retention time update
This commit is contained in:
parent
c2539c71a8
commit
cba9628780
@ -50,10 +50,10 @@ class ModelPolicyRetention extends Model {
|
|||||||
|
|
||||||
$default_retention = DEFAULT_RETENTION * 86400;
|
$default_retention = DEFAULT_RETENTION * 86400;
|
||||||
|
|
||||||
$delta = NOW + 86400 * $data['days'] - $default_retention;
|
$retained = NOW + 86400 * $data['days'];
|
||||||
$start_ts = NOW - 2*$default_retention;
|
$start_ts = NOW - 2*$default_retention;
|
||||||
|
|
||||||
$query = $this->db->query("UPDATE " . VIEW_MESSAGES . " SET retained=? WHERE arrived > ? AND (todomain=? OR fromdomain=?)", array($delta, $start_ts, $data['domain'], $data['domain']));
|
$query = $this->db->query("UPDATE " . VIEW_MESSAGES . " SET retained = ? WHERE arrived > ? AND (todomain=? OR fromdomain=?)", array($retained, $start_ts, $data['domain'], $data['domain']));
|
||||||
|
|
||||||
if(ENABLE_SYSLOG == 1) { syslog(LOG_INFO, sprintf("update retention date: domain='%s', days=%d, hits=%d, exec time=%.2f sec", $data['domain'], $data['days'], $this->db->countAffected(), $query->exec_time)); }
|
if(ENABLE_SYSLOG == 1) { syslog(LOG_INFO, sprintf("update retention date: domain='%s', days=%d, hits=%d, exec time=%.2f sec", $data['domain'], $data['days'], $this->db->countAffected(), $query->exec_time)); }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user