mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-16 20:05:14 +02:00
Merge branch 'develop' into improvement/ping-performance
This commit is contained in:
commit
8e50254bb9
34 changed files with 1448 additions and 880 deletions
22
boot.php
22
boot.php
|
@ -127,6 +127,10 @@ define ( 'CACHE_MONTH', 0 );
|
|||
define ( 'CACHE_WEEK', 1 );
|
||||
define ( 'CACHE_DAY', 2 );
|
||||
define ( 'CACHE_HOUR', 3 );
|
||||
define ( 'CACHE_HALF_HOUR', 4 );
|
||||
define ( 'CACHE_QUARTER_HOUR', 5 );
|
||||
define ( 'CACHE_FIVE_MINUTES', 6 );
|
||||
define ( 'CACHE_MINUTE', 7 );
|
||||
/* @}*/
|
||||
|
||||
/**
|
||||
|
@ -1159,23 +1163,33 @@ class App {
|
|||
|
||||
$this->remove_inactive_processes();
|
||||
|
||||
q("START TRANSACTION");
|
||||
|
||||
$r = q("SELECT `pid` FROM `process` WHERE `pid` = %d", intval(getmypid()));
|
||||
if(!dbm::is_result($r))
|
||||
if(!dbm::is_result($r)) {
|
||||
q("INSERT INTO `process` (`pid`,`command`,`created`) VALUES (%d, '%s', '%s')",
|
||||
intval(getmypid()),
|
||||
dbesc($command),
|
||||
dbesc(datetime_convert()));
|
||||
}
|
||||
q("COMMIT");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Remove inactive processes
|
||||
*/
|
||||
function remove_inactive_processes() {
|
||||
q("START TRANSACTION");
|
||||
|
||||
$r = q("SELECT `pid` FROM `process`");
|
||||
if(dbm::is_result($r))
|
||||
foreach ($r AS $process)
|
||||
if (!posix_kill($process["pid"], 0))
|
||||
if(dbm::is_result($r)) {
|
||||
foreach ($r AS $process) {
|
||||
if (!posix_kill($process["pid"], 0)) {
|
||||
q("DELETE FROM `process` WHERE `pid` = %d", intval($process["pid"]));
|
||||
}
|
||||
}
|
||||
}
|
||||
q("COMMIT");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue