// db_query($link, "BEGIN");
- $result = db_query($link, "SELECT title,icon_url,site_url,owner_uid
+ if (DB_TYPE == "pgsql") {
+ $favicon_interval_qpart = "favicon_last_checked < NOW() - INTERVAL '12 hour'";
+ } else {
+ $favicon_interval_qpart = "favicon_last_checked < DATE_SUB(NOW(), INTERVAL 12 HOUR)";
+ }
+
+ $result = db_query($link, "SELECT title,icon_url,site_url,owner_uid,
+ (favicon_last_checked IS NULL OR $favicon_interval_qpart) AS
+ favicon_needs_check
FROM ttrss_feeds WHERE id = '$feed'");
$registered_title = db_fetch_result($result, 0, "title");
$orig_icon_url = db_fetch_result($result, 0, "icon_url");
$orig_site_url = db_fetch_result($result, 0, "site_url");
+ $favicon_needs_check = sql_bool_to_bool(db_fetch_result($result, 0,
+ "favicon_needs_check"));
$owner_uid = db_fetch_result($result, 0, "owner_uid");
_debug("update_rss_feed: checking favicon...");
}
- check_feed_favicon($site_url, $feed, $link);
+ if ($favicon_needs_check) check_feed_favicon($site_url, $feed, $link);
if (!$registered_title || $registered_title == "[Unknown]") {
purge_feed($link, $feed, 0, $debug_enabled);
db_query($link, "UPDATE ttrss_feeds
- SET last_updated = NOW(), last_error = '' WHERE id = '$feed'");
+ SET last_updated = NOW(),
+ favicon_last_checked = NOW(),
+ last_error = '' WHERE id = '$feed'");
// db_query($link, "COMMIT");
update_on_checksum_change boolean not null default false,
strip_images boolean not null default false,
pubsub_state integer not null default 0,
+ favicon_last_checked datetime default null,
index(owner_uid),
foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE,
index(cat_id),
create table ttrss_version (schema_version int not null) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
-insert into ttrss_version values (91);
+insert into ttrss_version values (92);
create table ttrss_enclosures (id integer primary key auto_increment,
content_url text not null,
update_on_checksum_change boolean not null default false,
strip_images boolean not null default false,
pubsub_state integer not null default 0,
+ favicon_last_checked timestamp default null,
auth_pass_encrypted boolean not null default false);
create index ttrss_feeds_owner_uid_index on ttrss_feeds(owner_uid);
create table ttrss_version (schema_version int not null);
-insert into ttrss_version values (91);
+insert into ttrss_version values (92);
create table ttrss_enclosures (id serial not null primary key,
content_url text not null,