fixed bug 15115: Disabling heartbeat is not working under some circunstances in 3.0 RC2
authorAsier Lostalé <asier.lostale@openbravo.com>
Thu, 04 Nov 2010 17:21:24 +0100
changeset 8785 ea6d8848a675
parent 8784 0ead9342d172
child 8786 974f18d14979
fixed bug 15115: Disabling heartbeat is not working under some circunstances in 3.0 RC2

Log saved in process run is truncted to 4000 characters
src/org/openbravo/scheduling/ProcessRunner.java
--- a/src/org/openbravo/scheduling/ProcessRunner.java	Mon Nov 01 15:27:53 2010 +0100
+++ b/src/org/openbravo/scheduling/ProcessRunner.java	Thu Nov 04 17:21:24 2010 +0100
@@ -91,8 +91,13 @@
     } finally {
       final String duration = ProcessMonitor.getDuration(endTime - startTime);
       ProcessRequestData.update(conn, COMPLETE, requestId);
-      ProcessRunData.update(conn, ctx.getUser(), status, duration, bundle.getLog().toString(),
-          executionId);
+
+      // Get process log and truncate to 4000 characters if it is bigger
+      String processLog = bundle.getLog();
+      if (processLog.length() > 4000) {
+        processLog = processLog.substring(0, 3997) + "...";
+      }
+      ProcessRunData.update(conn, ctx.getUser(), status, duration, processLog, executionId);
     }
 
     return executionId;