throw new StorageException(sprintf('Database storage failed to update %s', $reference), 500, new Exception($this->dba->errorMessage(), $this->dba->errorNo()));
}
- return $this->dba->lastInsertId();
+ return (string) $this->dba->lastInsertId();
}
}
/**
* Returns the current Load of the System
- *
- * @return integer
*/
- public static function currentLoad()
+ public static function currentLoad(): float
{
if (!function_exists('sys_getloadavg')) {
- return false;
+ return (float) 0;
}
$load_arr = sys_getloadavg();
if (!is_array($load_arr)) {
- return false;
+ return (float) 0;
}
return round(max($load_arr[0], $load_arr[1]), 2);
->set('system', 'maintenance', false)
->delete('system', 'maintenance_reason')
->commit();
- return $r;
+ return 'Pre update failed';
} else {
DI::logger()->notice('Pre update executed.', ['version' => $version]);
}
->set('system', 'maintenance', false)
->delete('system', 'maintenance_reason')
->commit();
- return $r;
+ return 'Post update failed';
} else {
DI::config()->set('system', 'build', $version);
DI::logger()->notice('Post update executed.', ['version' => $version]);
*
* @param integer $priority The priority that should be checked
*
- * @return integer Is there a process running with that priority?
+ * @return bool Is there a process running with that priority?
* @throws \Exception
*/
- private static function processWithPriorityActive(int $priority): int
+ private static function processWithPriorityActive(int $priority): bool
{
$condition = ["`priority` <= ? AND `pid` != 0 AND NOT `done`", $priority];
+
return DBA::exists('workerqueue', $condition);
}
/**
* Returns the priority of the next workerqueue job
*
- * @return string|bool priority or FALSE on failure
+ * @return int|false priority or FALSE on failure
* @throws \Exception
*/
private static function nextPriority()