Always update feed url to avoid useless redirections for future requests

This commit is contained in:
Frederic Guillot 2016-12-27 21:34:28 -05:00
parent f80878422d
commit d236afeb74
3 changed files with 5 additions and 3 deletions

View File

@ -9,6 +9,7 @@ Version 1.2.0 (unreleased)
* Remove automatic software update from the user interface
* New API methods (not backward compatible)
* Fever API tokens are longer than before
* Always update feed URL to avoid useless redirections for futures requests
* Add support for Wallabag service
* Add unit tests

View File

@ -113,9 +113,10 @@ function update_feed($user_id, $feed_id)
} else {
Model\Feed\update_feed($user_id, $feed_id, array(
'etag' => $resource->getEtag(),
'feed_url' => $resource->getUrl(),
'etag' => $resource->getEtag(),
'last_modified' => $resource->getLastModified(),
'last_checked' => time(),
'last_checked' => time(),
'parsing_error' => 0,
));
}

View File

@ -65,6 +65,6 @@ function write_debug_file() {
if (DEBUG_MODE) {
$feed_logs = Logger::getMessages();
$db_logs = Database::getInstance('db')->getLogMessages();
file_put_contents(DEBUG_FILENAME, implode(PHP_EOL, array_merge($feed_logs, $db_logs)), FILE_APPEND|LOCK_EX);
file_put_contents(DEBUG_FILENAME, implode(PHP_EOL, $feed_logs + $db_logs), FILE_APPEND|LOCK_EX);
}
}