[*] MQ миграции таблиц
This commit is contained in:
1 parent
2bcd7f16cb
commit
90af02f6cb
5 files changed
+26
-25
No files matched your search
@@ -208,7 +208,8 @@
|
||||
</a>
|
||||
<div class="media-body">
|
||||
<h4 class="media-heading"><?=$arUser['name']; ?></h4>
|
||||
<small class="text-muted"><?=$arUser['access_level']; ?></small>
|
||||
<small class="text-muted"><?=$arUser['email'];?>
|
||||
</small>
|
||||
</div>
|
||||
</div><!-- media -->
|
||||
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@
|
||||
<td><?=$MQ->getCountTasks();?></td>
|
||||
<td><?=$MQ->getCountTasks(['active' => 'Y', 'in_progress' => 'N']);?></td>
|
||||
<td><?=$MQ->getCountTasks(['active' => 'Y', 'in_progress' => 'Y']);?></td>
|
||||
<td><?=$MQ->getCountTasks(['active' => 'N', 'in_progress' => 'N', 'status' => MQ::STATUS_ERROR]);?></td>
|
||||
<td><?=$MQ->getCountTasks(['in_progress' => 'N', 'status' => MQ::STATUS_ERROR]);?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
+15
-16
@@ -1,20 +1,19 @@
|
||||
CREATE TABLE `threads` (
|
||||
`id` int(11) NOT NULL,
|
||||
`active` varchar(1) NOT NULL DEFAULT 'N',
|
||||
`in_progress` varchar(1) NOT NULL DEFAULT 'N',
|
||||
`executed` varchar(1) NOT NULL DEFAULT 'N',
|
||||
`execution_time` varchar(255) DEFAULT NULL,
|
||||
`attempts` int(11) NOT NULL,
|
||||
`date_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`date_updated` datetime DEFAULT NULL,
|
||||
`class` varchar(255) DEFAULT NULL,
|
||||
`method` varchar(255) DEFAULT NULL,
|
||||
`params` text,
|
||||
`status` varchar(255) DEFAULT NULL,
|
||||
`response` text
|
||||
`id` int(11) NOT NULL,
|
||||
`active` varchar(1) NOT NULL DEFAULT 'N',
|
||||
`in_progress` varchar(1) NOT NULL DEFAULT 'N',
|
||||
`priority` int(11) DEFAULT NULL,
|
||||
`execution_time` varchar(255) DEFAULT NULL,
|
||||
`attempts` int(11) NOT NULL,
|
||||
`attempts_limit` int(11) DEFAULT '1',
|
||||
`date_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`date_updated` datetime DEFAULT NULL,
|
||||
`class` varchar(255) DEFAULT NULL,
|
||||
`method` varchar(255) DEFAULT NULL,
|
||||
`params` text,
|
||||
`status` varchar(255) DEFAULT NULL,
|
||||
`response` text
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
ALTER TABLE `threads` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`);
|
||||
|
||||
ALTER TABLE `threads` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17923;
|
||||
ALTER TABLE `threads` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=78989;
|
||||
COMMIT;
|
||||
@@ -398,7 +398,7 @@
|
||||
'active' => self::VALUE_N,
|
||||
'in_progress' => self::VALUE_N,
|
||||
'attempts' => '0',
|
||||
'attempts_limit' => $this->attempts,
|
||||
'attempts_limit' => $this->runNow ? '1' : $this->attempts, // Если запускаем немедленно, то попытка одна
|
||||
'class' => !empty($class) ? addslashes($class) : '',
|
||||
'method' => $method,
|
||||
'priority' => $priority,
|
||||
@@ -504,11 +504,11 @@
|
||||
}
|
||||
|
||||
if (!empty($arTask['class']) && !method_exists($arTask['class'], $arTask['method'])) {
|
||||
throw new CoreException('Класс или метод не определен, невозможно выполнить', CoreException::ERROR_CLASS_OR_METHOD_NOT_FOUND);
|
||||
throw new CoreException('Класс или метод не существует, невозможно выполнить', CoreException::ERROR_CLASS_OR_METHOD_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (empty($arTask['class']) && !empty($arTask['method']) && !function_exists($arTask['method'])) {
|
||||
throw new CoreException('Функция не определена, невозможно выполнить', CoreException::ERROR_CLASS_OR_METHOD_NOT_FOUND);
|
||||
throw new CoreException('Функция не существует, невозможно выполнить', CoreException::ERROR_CLASS_OR_METHOD_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (empty($arTask['class'])) {
|
||||
@@ -572,7 +572,7 @@
|
||||
);
|
||||
|
||||
// TODO: Следующая строка нужна больше для отладки - в дальнейшем нужно удалить ее
|
||||
echo 'Exception: ' . $t->getFile() . ' в строке ' . $t->getLine() . PHP_EOL . $t->getMessage() . PHP_EOL;
|
||||
//echo 'Exception: ' . $t->getFile() . ' в строке ' . $t->getLine() . PHP_EOL . $t->getMessage() . PHP_EOL;
|
||||
}
|
||||
|
||||
return $response;
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
CREATE TABLE if not exists `threads` (
|
||||
CREATE TABLE `threads` (
|
||||
`id` int(11) NOT NULL,
|
||||
`active` varchar(1) NOT NULL DEFAULT 'N',
|
||||
`in_progress` varchar(1) NOT NULL DEFAULT 'N',
|
||||
`executed` varchar(1) NOT NULL DEFAULT 'N',
|
||||
`priority` int(11) DEFAULT NULL,
|
||||
`execution_time` varchar(255) DEFAULT NULL,
|
||||
`attempts` int(11) NOT NULL,
|
||||
`attempts_limit` int(11) DEFAULT '1',
|
||||
`date_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`date_updated` datetime DEFAULT NULL,
|
||||
`class` varchar(255) DEFAULT NULL,
|
||||
@@ -14,4 +15,4 @@ CREATE TABLE if not exists `threads` (
|
||||
`response` text
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
ALTER TABLE `threads` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`);
|
||||
ALTER TABLE `threads` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17923;
|
||||
ALTER TABLE `threads` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=78989;
|
||||
Reference in new issue
Block a user