Merge remote-tracking branch 'origin/1.8.x' into feat-txn

# Conflicts:
#	composer.lock
This commit is contained in:
Jake Barnby 2025-09-12 01:45:41 +12:00
commit 1403868d05
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C

View file

@ -174,6 +174,9 @@ class Certificates extends Action
$success = false;
try {
$date = \date('H:i:s');
$certificate->setAttribute('logs', "\033[90m[{$date}] \033[97mCertificate generation started. \033[0m\n");
// Validate domain and DNS records. Skip if job is forced
if (!$skipRenewCheck) {
$mainDomain = $validationDomain ?? $this->getMainDomain();
@ -201,9 +204,11 @@ class Certificates extends Action
$success = true;
} catch (Throwable $e) {
$logs = $e->getMessage();
$currentLogs = $certificate->getAttribute('logs', '');
$date = \date('H:i:s');
$errorMessage = "\033[90m[{$date}] \033[31mCertificate generation failed: \033[0m\n";
// Set exception as log in certificate document
$certificate->setAttribute('logs', \mb_strcut($logs, 0, 1000000));// Limit to 1MB
$certificate->setAttribute('logs', $currentLogs . $errorMessage . \mb_strcut($logs, 0, 500000));// Limit to 500kb
// Increase attempts count
$attempts = $certificate->getAttribute('attempts', 0) + 1;