move update_rss_feed transaction lock after $rss validity check

master
Andrew Dolgov 19 years ago
parent 25af8dadb4
commit dd8c76a9a2

@ -175,12 +175,12 @@
error_reporting (DEFAULT_ERROR_LEVEL); error_reporting (DEFAULT_ERROR_LEVEL);
db_query($link, "BEGIN");
$feed = db_escape_string($feed); $feed = db_escape_string($feed);
if ($rss) { if ($rss) {
db_query($link, "BEGIN");
$result = db_query($link, "SELECT title,icon_url,site_url,owner_uid $result = db_query($link, "SELECT title,icon_url,site_url,owner_uid
FROM ttrss_feeds WHERE id = '$feed'"); FROM ttrss_feeds WHERE id = '$feed'");
@ -459,6 +459,8 @@
db_query($link, "UPDATE ttrss_feeds db_query($link, "UPDATE ttrss_feeds
SET last_updated = NOW(), last_error = '' WHERE id = '$feed'"); SET last_updated = NOW(), last_error = '' WHERE id = '$feed'");
db_query($link, "COMMIT");
} else { } else {
$error_msg = db_escape_string(magpie_error()); $error_msg = db_escape_string(magpie_error());
db_query($link, db_query($link,
@ -466,8 +468,6 @@
last_updated = NOW() WHERE id = '$feed'"); last_updated = NOW() WHERE id = '$feed'");
} }
db_query($link, "COMMIT");
} }
function print_select($id, $default, $values, $attributes = "") { function print_select($id, $default, $values, $attributes = "") {

Loading…
Cancel
Save