mirror of
https://github.com/friendica/friendica
synced 2024-12-22 22:00:16 +00:00
The direct structure call is now only executed when called via the poller.php
This commit is contained in:
parent
d691c2e621
commit
2971501f63
4 changed files with 8 additions and 6 deletions
4
boot.php
4
boot.php
|
@ -591,7 +591,7 @@ function is_ajax() {
|
|||
return (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');
|
||||
}
|
||||
|
||||
function check_db() {
|
||||
function check_db($via_worker) {
|
||||
|
||||
$build = get_config('system', 'build');
|
||||
if (!x($build)) {
|
||||
|
@ -600,7 +600,7 @@ function check_db() {
|
|||
}
|
||||
if ($build != DB_UPDATE_VERSION) {
|
||||
// When we cannot execute the database update via the worker, we will do it directly
|
||||
if (!proc_run(PRIORITY_CRITICAL, 'include/dbupdate.php')) {
|
||||
if (!proc_run(PRIORITY_CRITICAL, 'include/dbupdate.php') && $via_worker) {
|
||||
update_db(get_app());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -890,6 +890,9 @@ function poller_run_cron() {
|
|||
}
|
||||
|
||||
if (array_search(__file__,get_included_files())===0) {
|
||||
// Check the database structure and possibly fixes it
|
||||
check_db(true);
|
||||
|
||||
poller_run($_SERVER["argv"],$_SERVER["argc"]);
|
||||
|
||||
poller_unclaim_process();
|
||||
|
|
|
@ -196,7 +196,7 @@ if ($install && $a->module!="view") {
|
|||
$a->module = 'maintenance';
|
||||
} else {
|
||||
check_url($a);
|
||||
check_db();
|
||||
check_db(false);
|
||||
check_plugins($a);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ echo "New DB VERSION: " . DB_UPDATE_VERSION . "\n";
|
|||
|
||||
if ($build != DB_UPDATE_VERSION) {
|
||||
echo "Updating database...";
|
||||
check_db($a);
|
||||
update_db($a);
|
||||
echo "Done\n";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue