Revert "Update core/SQL_DUMPS/users.sql, core/bootstrap.php, core/migrations/000002_users.sql"

This reverts commit f5aa2e57f8
This commit is contained in:
rsgrinko committed 2022-07-10 18:54:30 +00:00
1 parent f5aa2e57f8
commit be165bdf45
5 files changed
+141 -5

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
<?php
$_SERVER['DOCUMENT_ROOT'] = '/home/rsgrinko/sites/dev.it-stories.ru';
require_once $_SERVER['DOCUMENT_ROOT'] . '/core/bootstrap.php';
use Core\ExternalServices\TelegramSender;
use Core\Helpers\Log;
throw new Exception('test ololo');
//Log::logToSentry('Тестовая ошибка', 'ERROR', $_REQUEST);
die();
$numProc = 4;
if (empty($argv[1])) {
$currentRunThread = (int)exec('ps -awx | grep \'test.php\' | grep -v \'grep\' | wc -l');
echo 'Now running: ' . $currentRunThread . PHP_EOL;
while ($currentRunThread <= $numProc) {
echo 'Run new (' . $currentRunThread . ')' . PHP_EOL;
$handler = '(php -f /home/rsgrinko/sites/dev.it-stories.ru/test.php ' . $currentRunThread . ' &) >> /dev/null 2>&1';
passthru($handler);
$currentRunThread = (int)exec('ps -awx | grep \'test.php\' | grep -v \'grep\' | wc -l');
echo 'Now running: ' . $currentRunThread . PHP_EOL;
}
} else {
$res = (new TelegramSender(TELEGRAM_BOT_TOKEN))->setChat(TELEGRAM_NOTIFICATION_CHANNEL)->sendMessage('Start proc #' . $argv[1]);
Log::logToFile(json_encode($res, JSON_UNESCAPED_UNICODE), 'test.log', $argv[1]);
sleep(rand(2, 10));
$res = (new TelegramSender(TELEGRAM_BOT_TOKEN))->setChat(TELEGRAM_NOTIFICATION_CHANNEL)->sendMessage('End proc #' . $argv[1]);
Log::logToFile(json_encode($res, JSON_UNESCAPED_UNICODE), 'test.log', $argv[1]);
}