PMCORE-1142_A Artisan stops sending emails if it is left for several hours doing nothing.
This commit is contained in:
4
thirdparty/propel/Propel.php
vendored
4
thirdparty/propel/Propel.php
vendored
@@ -601,7 +601,9 @@ class Propel
|
||||
foreach (self::$connectionMap as $cnn) {
|
||||
if (get_class($cnn) != "DBArrayConnection") {
|
||||
if (isset($cnn->lastQuery)) {
|
||||
if (gettype($cnn->getResource()) == "resource" && $cnn->isConnected() && $cnn->lastQuery != $lastQuery) {
|
||||
$existsIsConnectedMethod = method_exists($cnn, "isConnected");
|
||||
$existsCloseMethod = method_exists($cnn, "close");
|
||||
if ($existsIsConnectedMethod && $existsCloseMethod && $cnn->isConnected() && $cnn->lastQuery != $lastQuery) {
|
||||
$cnn->close();
|
||||
}
|
||||
$lastQuery = $cnn->lastQuery;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace ProcessMaker\Core;
|
||||
|
||||
use Bootstrap;
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use ProcessMaker\BusinessModel\Factories\Jobs;
|
||||
@@ -140,12 +141,14 @@ class JobsManager
|
||||
|
||||
$_SESSION = $environment['session'];
|
||||
$_SERVER = $environment['server'];
|
||||
Propel::initConfiguration($environment['configuration']);
|
||||
foreach ($environment['constants'] as $key => $value) {
|
||||
if (!defined($key)) {
|
||||
define($key, $value);
|
||||
}
|
||||
}
|
||||
|
||||
Propel::close();
|
||||
Propel::init(PATH_CONFIG . "databases.php");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -190,6 +193,11 @@ class JobsManager
|
||||
$callback($environment);
|
||||
} catch (Exception $e) {
|
||||
Log::error($e->getMessage() . ": " . $e->getTraceAsString());
|
||||
$context = [
|
||||
"trace" => $e->getTraceAsString(),
|
||||
"workspace" => $environment["constants"]["SYS_SYS"]
|
||||
];
|
||||
Bootstrap::registerMonolog("queue:work", 400, $e->getMessage(), $context, "");
|
||||
throw $e;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user