Compare commits
No commits in common. "master" and "v2.7.0" have entirely different histories.
20
plan.inc.php
20
plan.inc.php
|
@ -16,8 +16,6 @@ class Plan
|
||||||
const BOGUS_REINSTALL_APP_EVERY_N = 2;
|
const BOGUS_REINSTALL_APP_EVERY_N = 2;
|
||||||
const IM_THREAD_UPDATE_INTERVAL = 5;
|
const IM_THREAD_UPDATE_INTERVAL = 5;
|
||||||
|
|
||||||
const MaxImTextPostLen = 3000;
|
|
||||||
|
|
||||||
public Session $session;
|
public Session $session;
|
||||||
|
|
||||||
public string $name;
|
public string $name;
|
||||||
|
@ -553,7 +551,7 @@ class Plan
|
||||||
|
|
||||||
static function _printToShellExtItem(Task $task, array $item)
|
static function _printToShellExtItem(Task $task, array $item)
|
||||||
{
|
{
|
||||||
$shell_msg = _trim($item['message'], self::MaxImTextPostLen);
|
$shell_msg = _trim($item['message'], 3000);
|
||||||
if(Task::isProblemCode($item['error']))
|
if(Task::isProblemCode($item['error']))
|
||||||
$shell_msg = "[PRB] Code:{$item['error']}, $shell_msg";
|
$shell_msg = "[PRB] Code:{$item['error']}, $shell_msg";
|
||||||
$shell_msg = "(".round($item['time'],1)."s) {$shell_msg} *{$task->device}*";
|
$shell_msg = "(".round($item['time'],1)."s) {$shell_msg} *{$task->device}*";
|
||||||
|
@ -563,7 +561,7 @@ class Plan
|
||||||
|
|
||||||
function _postToMessengerExtStatusItem(Task $task, array $item)
|
function _postToMessengerExtStatusItem(Task $task, array $item)
|
||||||
{
|
{
|
||||||
$orig_msg = _trim($item['message'], self::MaxImTextPostLen);
|
$orig_msg = _trim($item['message'], 3000);
|
||||||
$mm_msg = $orig_msg;
|
$mm_msg = $orig_msg;
|
||||||
|
|
||||||
if($item['error'] == Task::CODE_EXCEPTION)
|
if($item['error'] == Task::CODE_EXCEPTION)
|
||||||
|
@ -642,10 +640,6 @@ class Plan
|
||||||
{
|
{
|
||||||
$this->_postToMessengerExtStatusItem($task, $item);
|
$this->_postToMessengerExtStatusItem($task, $item);
|
||||||
}
|
}
|
||||||
else if($item['error'] == Task::CODE_RAW)
|
|
||||||
{
|
|
||||||
$this->_postRawDataToMessenger($task, $item['message']);
|
|
||||||
}
|
|
||||||
else if($msg_type === '[WRN]')
|
else if($msg_type === '[WRN]')
|
||||||
{
|
{
|
||||||
$task->addStatusCode(Task::CODE_WARN);
|
$task->addStatusCode(Task::CODE_WARN);
|
||||||
|
@ -680,19 +674,11 @@ class Plan
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function _postRawDataToMessenger(Task $task, string $txt)
|
|
||||||
{
|
|
||||||
if(strlen($txt) > self::MaxImTextPostLen)
|
|
||||||
$this->postFileData("Raw data: *{$task->device}*", 'text/plain', $txt, '.txt');
|
|
||||||
else
|
|
||||||
$this->post("Raw data: \n```\n$txt\n```\n *{$task->device}*");
|
|
||||||
}
|
|
||||||
|
|
||||||
function _postReplayToMessenger(Task $task, $repl_txt)
|
function _postReplayToMessenger(Task $task, $repl_txt)
|
||||||
{
|
{
|
||||||
$repl_txt = _try_lz4_replay($repl_txt);
|
$repl_txt = _try_lz4_replay($repl_txt);
|
||||||
|
|
||||||
if(strlen($repl_txt) > self::MaxImTextPostLen)
|
if(strlen($repl_txt) > 3000)
|
||||||
$this->postFileData("Replay File: *{$task->device}*", 'text/plain', $repl_txt, '.txt');
|
$this->postFileData("Replay File: *{$task->device}*", 'text/plain', $repl_txt, '.txt');
|
||||||
else
|
else
|
||||||
$this->post("Last Replay: \n```\n$repl_txt\n```\n *{$task->device}*");
|
$this->post("Last Replay: \n```\n$repl_txt\n```\n *{$task->device}*");
|
||||||
|
|
|
@ -26,7 +26,6 @@ class Task
|
||||||
const CODE_MESSAGE = 0;
|
const CODE_MESSAGE = 0;
|
||||||
const CODE_EXCEPTION = 1;
|
const CODE_EXCEPTION = 1;
|
||||||
const CODE_WARN = 2;
|
const CODE_WARN = 2;
|
||||||
const CODE_RAW = 3;
|
|
||||||
const CODE_NSTART = 124;
|
const CODE_NSTART = 124;
|
||||||
const CODE_STUCK = 125;
|
const CODE_STUCK = 125;
|
||||||
const CODE_GONE = 126;
|
const CODE_GONE = 126;
|
||||||
|
@ -43,8 +42,6 @@ class Task
|
||||||
return "exception";
|
return "exception";
|
||||||
case self::CODE_WARN:
|
case self::CODE_WARN:
|
||||||
return "warning";
|
return "warning";
|
||||||
case self::CODE_RAW:
|
|
||||||
return "raw";
|
|
||||||
case self::CODE_STUCK:
|
case self::CODE_STUCK:
|
||||||
return "stuck";
|
return "stuck";
|
||||||
case self::CODE_NSTART:
|
case self::CODE_NSTART:
|
||||||
|
|
Loading…
Reference in New Issue