use Friendica\Core\Config\Configuration;
use Friendica\Core\Config\PConfiguration;
use Friendica\Core\L10n\L10n;
-use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Core\Theme;
use Friendica\Database\Database;
use Friendica\Model\Profile;
-use Friendica\Module\Security\Login;
use Friendica\Module\Special\HTTPException as ModuleHTTPException;
use Friendica\Network\HTTPException;
use Friendica\Util\ConfigFileLoader;
$this->getBaseURL();
}
- /**
- * @deprecated 2019.09 - use Core\Process->isMaxProcessesReached() instead
- */
- public function isMaxProcessesReached()
- {
- return $this->process->isMaxProcessesReached();
- }
-
- /**
- * @deprecated 2019.09 - use Core\Process->isMinMemoryReached() instead
- */
- public function isMinMemoryReached()
- {
- return $this->process->isMinMemoryReached();
- }
-
- /**
- * @deprecated 2019.09 - use Core\Process->isMaxLoadReached() instead
- */
- public function isMaxLoadReached()
- {
- return $this->process->isMaxLoadReached();
- }
-
/**
* Generates the site's default sender email address
*
self::$up_start = microtime(true);
// At first check the maximum load. We shouldn't continue with a high load
- if ($a->isMaxLoadReached()) {
+ if (DI::process()->isMaxLoadReached()) {
Logger::log('Pre check: maximum load reached, quitting.', Logger::DEBUG);
return;
}
}
// Do we have too few memory?
- if ($a->isMinMemoryReached()) {
+ if (DI::process()->isMinMemoryReached()) {
Logger::log('Pre check: Memory limit reached, quitting.', Logger::DEBUG);
return;
}
}
// Possibly there are too much database processes that block the system
- if ($a->isMaxProcessesReached()) {
+ if (DI::process()->isMaxProcessesReached()) {
Logger::log('Pre check: maximum processes reached, quitting.', Logger::DEBUG);
return;
}
}
// Check free memory
- if ($a->isMinMemoryReached()) {
+ if (DI::process()->isMinMemoryReached()) {
Logger::log('Memory limit reached, quitting.', Logger::DEBUG);
Lock::release('worker');
return;
*/
public static function execute($queue)
{
- $a = \get_app();
-
$mypid = getmypid();
// Quit when in maintenance
}
// Constantly check the number of parallel database processes
- if ($a->isMaxProcessesReached()) {
+ if (DI::process()->isMaxProcessesReached()) {
Logger::log("Max processes reached for process ".$mypid, Logger::DEBUG);
return false;
}
use Friendica\Core\Config\PConfiguration;
use Friendica\Core\L10n\L10n;
use Friendica\Core\Lock\ILock;
+use Friendica\Core\Process;
use Friendica\Core\Session\ISession;
use Friendica\Database\Database;
use Friendica\Model\Notify;
* @method static App\Router router()
* @method static Database dba()
* @method static FileSystem fs()
+ * @method static Process process()
*
*/
class DI
'dba' => Database::class,
'fs' => FileSystem::class,
'profiler' => Profiler::class,
+ 'process' => Process::class,
];
/** @var Dice */