расширил информацию ошибок базы
This commit is contained in:
1 parent
85bea9433d
commit
6601901f01
3 files changed
+11
-4
No files matched your search
@@ -190,6 +190,9 @@
|
||||
$itemId = $DB->addItem('jokes', ['hash' => $hash, 'text' => $joke]);
|
||||
}
|
||||
}
|
||||
if($i < 1 ) {
|
||||
throw new CoreException('Новых шуток не найдено');
|
||||
}
|
||||
return 'Добавлено ' . $i . ' шуток из ' . count($arJokes);
|
||||
}
|
||||
|
||||
|
||||
@@ -213,9 +213,12 @@
|
||||
try {
|
||||
$stmt = $this->db->query($sql);
|
||||
} catch (\Throwable $t) {
|
||||
sendTelegram('SQL ERROR: ' . $sql);
|
||||
sendTelegram(
|
||||
'<b><u>' . date('d.m.Y H:i:s') . '</u></b>' . PHP_EOL . '</b><b>SQL ERROR:</b> ' . PHP_EOL . $this->db->errorInfo()[2] . PHP_EOL
|
||||
. '<b>QUERY:</b> ' . PHP_EOL . $sql
|
||||
);
|
||||
if(DEBUG) {
|
||||
throw new CoreException('В SQL запросе произошла ошибка. Запрос: ' . $sql, CoreException::ERROR_SQL_QUERY);
|
||||
throw new CoreException('В SQL запросе произошла ошибка. '.$this->db->errorInfo()[2].' Запрос: ' . $sql, CoreException::ERROR_SQL_QUERY);
|
||||
} else {
|
||||
throw new CoreException('В SQL запросе произошла ошибка', CoreException::ERROR_SQL_QUERY);
|
||||
}
|
||||
|
||||
@@ -355,7 +355,7 @@
|
||||
// Добор заданий
|
||||
$this->setTasksActiveStatus();
|
||||
|
||||
if ($this->hasMaxWorkers()) {
|
||||
if ($this->hasMaxWorkers() && !$childProcess) {
|
||||
if (USE_LOG) {
|
||||
Log::logToFile(
|
||||
'Достигнуто максимальное количество воркеров. Работает ' . $this->getCountWorkers() . '/' . self::WORKERS_LIMIT,
|
||||
@@ -438,7 +438,8 @@
|
||||
public function flush(): void
|
||||
{
|
||||
$this->stopAllWorkers();
|
||||
$this->DB->query('TRUNCATE ' . self::TABLE . '; TRUNCATE ' . self::TABLE_HISTORY . ';');
|
||||
$this->DB->query('TRUNCATE ' . self::TABLE . ';');
|
||||
$this->DB->query('TRUNCATE ' . self::TABLE_HISTORY . ';');
|
||||
}
|
||||
/**
|
||||
* Массовое создание заданий
|
||||
|
||||
Reference in new issue
Block a user