]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/DBUpdate.php
Move Config::get() to DI::config()->get()
[friendica.git] / src / Worker / DBUpdate.php
index fcf07c0b6506aee0823eb150abc61f72a8ae4b56..83c9fd32323b6b947225d9621231ebadb254f451 100644 (file)
@@ -1,21 +1,21 @@
 <?php
 /**
  * @file src/Worker/DBUpdate.php
- * @brief This file is called when the database structure needs to be updated
+ * This file is called when the database structure needs to be updated
  */
 namespace Friendica\Worker;
 
 use Friendica\Core\Config;
 use Friendica\Core\Update;
+use Friendica\DI;
 
 class DBUpdate
 {
        public static function execute()
        {
-               // We are deleting the latest dbupdate entry.
-               // This is done to avoid endless loops because the update was interupted.
-               Config::delete('database', 'dbupdate_'.DB_UPDATE_VERSION);
-
-               Update::run();
+               // Just in case the last update wasn't failed
+               if (DI::config()->get('system', 'update', Update::SUCCESS, true) != Update::FAILED) {
+                       Update::run(DI::app()->getBasePath());
+               }
        }
 }