<?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\BaseObject;
+use Friendica\Core\Config;
use Friendica\Core\Update;
+use Friendica\DI;
-class DBUpdate extends BaseObject
+class DBUpdate
{
public static function execute()
{
- Update::run(self::getApp()->getBasePath());
+ // 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());
+ }
}
}