N°2517 - Supportability - system report (Added cron user)

This commit is contained in:
Eric
2019-10-09 12:11:17 +02:00
parent eece09e5ed
commit 68895551b2
3 changed files with 12 additions and 1 deletions

View File

@@ -55,6 +55,7 @@ class BackgroundTask extends DBObject
MetaModel::Init_AddAttribute(new AttributeBoolean("running", array("allowed_values"=>null, "sql"=>"running", "default_value"=>false, "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeEnum("status", array("allowed_values"=>new ValueSetEnum('active,paused'), "sql"=>"status", "default_value"=>'active', "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeString("system_user", array("allowed_values"=>null, "sql"=>"system_user", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array())));
}
public function ComputeDurations($fLatestDuration)
@@ -73,4 +74,4 @@ class BackgroundTask extends DBObject
}
$this->Set('latest_run_duration', sprintf('%.3f',$fLatestDuration));
}
}
}

View File

@@ -424,6 +424,14 @@ class CMDBSource
return $aVersions[0];
}
/**
* @return string
*/
public static function GetServerInfo()
{
return mysqli_get_server_info ( self::$m_oMysqli );
}
/**
* Get the DB vendor between MySQL and its main forks
* @return string

View File

@@ -91,6 +91,8 @@ function RunTask($oProcess, BackgroundTask $oTask, $oStartDate, $iTimeLimit)
{
// Record (when starting) that this task was started, just in case it crashes during the execution
$oTask->Set('latest_run_date', $oDateStarted->format('Y-m-d H:i:s'));
// Record the current user running the cron
$oTask->Set('system_user', getenv("username"));
$oTask->DBUpdate();
$sMessage = $oProcess->Process($iTimeLimit);
}