add schema checking to feed updating and update script
This commit is contained in:
parent
a94379f118
commit
857efe49e6
|
@ -60,6 +60,12 @@
|
||||||
function update_daemon_common($link, $limit = DAEMON_FEED_LIMIT, $from_http = false, $debug = true) {
|
function update_daemon_common($link, $limit = DAEMON_FEED_LIMIT, $from_http = false, $debug = true) {
|
||||||
// Process all other feeds using last_updated and interval parameters
|
// Process all other feeds using last_updated and interval parameters
|
||||||
|
|
||||||
|
$schema_version = get_schema_version($link);
|
||||||
|
|
||||||
|
if ($schema_version != SCHEMA_VERSION) {
|
||||||
|
die("Schema version is wrong, please upgrade the database.\n");
|
||||||
|
}
|
||||||
|
|
||||||
define('PREFS_NO_CACHE', true);
|
define('PREFS_NO_CACHE', true);
|
||||||
|
|
||||||
// Test if the user has loggued in recently. If not, it does not update its feeds.
|
// Test if the user has loggued in recently. If not, it does not update its feeds.
|
||||||
|
|
|
@ -89,6 +89,14 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isset($options['update-schema'])) {
|
||||||
|
$schema_version = get_schema_version($link);
|
||||||
|
|
||||||
|
if ($schema_version != SCHEMA_VERSION) {
|
||||||
|
die("Schema version is wrong, please upgrade the database.\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
define('QUIET', isset($options['quiet']));
|
define('QUIET', isset($options['quiet']));
|
||||||
|
|
||||||
if (isset($options["log"])) {
|
if (isset($options["log"])) {
|
||||||
|
|
|
@ -183,6 +183,10 @@
|
||||||
|
|
||||||
db_close($link);
|
db_close($link);
|
||||||
|
|
||||||
|
if ($schema_version != SCHEMA_VERSION) {
|
||||||
|
die("Schema version is wrong, please upgrade the database.\n");
|
||||||
|
}
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
||||||
// Since sleep is interupted by SIGCHLD, we need another way to
|
// Since sleep is interupted by SIGCHLD, we need another way to
|
||||||
|
|
Loading…
Reference in New Issue