Skip to content

Commit

Permalink
Shrink output to prevent 'Database server has gone away' if output is…
Browse files Browse the repository at this point in the history
… too large
  • Loading branch information
LionelLaffineur committed Jan 18, 2023
1 parent 8b2411a commit 1bf42c3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Skeleton/Transaction/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public static function create(
$log = new self();
$log->transaction_id = $transaction->id;
$log->failed = $failed;
$log->output = $output;
$log->output = substr($output, 0, 16777215);

if (isset($t) === true) {
$log->exception = substr(print_r($t, true), 0, 16777215);
Expand Down
2 changes: 0 additions & 2 deletions lib/Skeleton/Transaction/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ public function unlock() {
* @access public
*/
public function mark_failed($output, $exception, $date = null) {
Database::reset();
Log::create($this, true, $output, $exception, $date);

$this->failed = true;
Expand All @@ -230,7 +229,6 @@ public function mark_failed($output, $exception, $date = null) {
* @param string $date
*/
public function mark_completed($output, $date = null) {
Database::reset();
Log::create($this, false, $output, $date);

// Don't mark this transaction as completed if it has been rescheduled.
Expand Down

0 comments on commit 1bf42c3

Please sign in to comment.