]> git.mxchange.org Git - friendica.git/commitdiff
hopefully better update handling - never update the current DB version or continue...
authorfriendica <info@friendica.com>
Mon, 23 Jul 2012 22:57:40 +0000 (15:57 -0700)
committerfriendica <info@friendica.com>
Mon, 23 Jul 2012 22:57:40 +0000 (15:57 -0700)
boot.php
mod/admin.php

index 018b3b9f3fcbdcd2732b17ac5e944a121a79518d..340ef139942bce9534b3e1e4b795f15ebf986aae 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -747,9 +747,10 @@ if(! function_exists('check_config')) {
                                                        // If the update fails or times-out completely you may need to
                                                        // delete the config entry to try again.
 
-                                                       if(get_config('database','update_' . $x))
+                                                       $t = get_config('database','update_' . $x);
+                                                       if($t !== false)
                                                                break;
-                                                       set_config('database','update_' . $x, '1');
+                                                       set_config('database','update_' . $x, time());
 
                                                        // call the specific update
 
@@ -772,13 +773,14 @@ if(! function_exists('check_config')) {
                                                                        . 'Content-transfer-encoding: 8bit' );
                                                                //try the logger
                                                                logger('CRITICAL: Update Failed: '. $x);
+                                                               break;
                                                        }
-                                                       else
+                                                       else {
                                                                set_config('database','update_' . $x, 'success');
-                                                               
+                                                               set_config('system','build', $x + 1);
+                                                       }                                                               
                                                }
                                        }
-                                       set_config('system','build', DB_UPDATE_VERSION);
                                }
                        }
                }
index c8ed7a53bb1ab91f5b05cf4c771a4968fa79a2d4..05af01aa41d55052a5ce88ff3c544003a8ff7efd 100644 (file)
@@ -471,6 +471,9 @@ function admin_page_dbsync(&$a) {
 
        if($a->argc > 3 && intval($a->argv[3]) && $a->argv[2] === 'mark') {
                set_config('database', 'update_' . intval($a->argv[3]), 'success');
+               $curr = get_config('system','build');
+               if(intval($curr) == intval($a->argv[3]))
+                       set_config('system','build',intval($curr) + 1);
                info( t('Update has been marked successful') . EOL);
                goaway($a->get_baseurl(true) . '/admin/dbsync');
        }