Skip to content

Commit 1bf42c3

Browse files
Shrink output to prevent 'Database server has gone away' if output is too large
1 parent 8b2411a commit 1bf42c3

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

lib/Skeleton/Transaction/Log.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public static function create(
9595
$log = new self();
9696
$log->transaction_id = $transaction->id;
9797
$log->failed = $failed;
98-
$log->output = $output;
98+
$log->output = substr($output, 0, 16777215);
9999

100100
if (isset($t) === true) {
101101
$log->exception = substr(print_r($t, true), 0, 16777215);

lib/Skeleton/Transaction/Transaction.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ public function unlock() {
209209
* @access public
210210
*/
211211
public function mark_failed($output, $exception, $date = null) {
212-
Database::reset();
213212
Log::create($this, true, $output, $exception, $date);
214213

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

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

0 commit comments

Comments
 (0)