fix auto expiration bug on MySQL backend
This commit is contained in:
@@ -5,9 +5,16 @@
|
|||||||
|
|
||||||
function purge_old_posts($link) {
|
function purge_old_posts($link) {
|
||||||
if (PURGE_OLD_DAYS > 0) {
|
if (PURGE_OLD_DAYS > 0) {
|
||||||
$result = db_query($link, "DELETE FROM ttrss_entries WHERE
|
|
||||||
marked = false AND
|
if (DB_TYPE == "pgsql") {
|
||||||
date_entered < NOW() - INTERVAL '".PURGE_OLD_DAYS." days'");
|
$result = db_query($link, "DELETE FROM ttrss_entries WHERE
|
||||||
|
marked = false AND
|
||||||
|
date_entered < NOW() - INTERVAL '".PURGE_OLD_DAYS." days'");
|
||||||
|
} else {
|
||||||
|
$result = db_query($link, "DELETE FROM ttrss_entries WHERE
|
||||||
|
marked = false AND
|
||||||
|
date_entered < DATE_SUB(NOW(), INTERVAL ".PURGE_OLD_DAYS." DAY)");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,7 +212,8 @@
|
|||||||
content_hash,
|
content_hash,
|
||||||
feed_id,
|
feed_id,
|
||||||
comments,
|
comments,
|
||||||
no_orig_date)
|
no_orig_date,
|
||||||
|
date_entered)
|
||||||
VALUES
|
VALUES
|
||||||
('$entry_title',
|
('$entry_title',
|
||||||
'$entry_guid',
|
'$entry_guid',
|
||||||
@@ -215,7 +223,8 @@
|
|||||||
'$content_hash',
|
'$content_hash',
|
||||||
'$feed',
|
'$feed',
|
||||||
'$entry_comments',
|
'$entry_comments',
|
||||||
$no_orig_date)";
|
$no_orig_date,
|
||||||
|
NOW())";
|
||||||
|
|
||||||
$result = db_query($link, $query);
|
$result = db_query($link, $query);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user