Add logging for self update

This commit is contained in:
David Bomba 2024-09-30 16:59:44 +10:00
parent 847c2cce66
commit e0e3c05e6c
2 changed files with 10 additions and 8 deletions

View File

@ -64,10 +64,12 @@ class SelfUpdateController extends BaseController
$file_headers = @get_headers($this->getDownloadUrl()); $file_headers = @get_headers($this->getDownloadUrl());
if(!is_array($file_headers)) { if(!is_array($file_headers)) {
nlog($file_headers);
return response()->json(['message' => 'There was a problem reaching the update server, please try again in a little while.'], 410); return response()->json(['message' => 'There was a problem reaching the update server, please try again in a little while.'], 410);
} }
if (stripos($file_headers[0], "404 Not Found") > 0 || (stripos($file_headers[0], "302 Found") > 0 && stripos($file_headers[7], "404 Not Found") > 0)) { if (stripos($file_headers[0], "404 Not Found") > 0 || (stripos($file_headers[0], "302 Found") > 0 && stripos($file_headers[7], "404 Not Found") > 0)) {
nlog($file_headers);
return response()->json(['message' => 'Download not yet available. Please try again shortly.'], 410); return response()->json(['message' => 'Download not yet available. Please try again shortly.'], 410);
} }

View File

@ -63,12 +63,12 @@ class AutoBillCron
nlog($auto_bill_partial_invoices->count().' partial invoices to auto bill'); nlog($auto_bill_partial_invoices->count().' partial invoices to auto bill');
$auto_bill_partial_invoices->chunk(400, function ($invoices) { $auto_bill_partial_invoices->chunk(40, function ($invoices) {
foreach ($invoices as $invoice) { foreach ($invoices as $invoice) {
AutoBill::dispatch($invoice->id, null); AutoBill::dispatch($invoice->id, null);
} }
sleep(2); sleep(1);
}); });
$auto_bill_invoices = Invoice::query() $auto_bill_invoices = Invoice::query()
@ -85,12 +85,12 @@ class AutoBillCron
nlog($auto_bill_invoices->count().' full invoices to auto bill'); nlog($auto_bill_invoices->count().' full invoices to auto bill');
$auto_bill_invoices->chunk(400, function ($invoices) { $auto_bill_invoices->chunk(40, function ($invoices) {
foreach ($invoices as $invoice) { foreach ($invoices as $invoice) {
AutoBill::dispatch($invoice->id, null); AutoBill::dispatch($invoice->id, null);
} }
sleep(2); sleep(1);
}); });
} else { } else {
//multiDB environment, need to //multiDB environment, need to
@ -111,12 +111,12 @@ class AutoBillCron
nlog($auto_bill_partial_invoices->count()." partial invoices to auto bill db = {$db}"); nlog($auto_bill_partial_invoices->count()." partial invoices to auto bill db = {$db}");
$auto_bill_partial_invoices->chunk(400, function ($invoices) use ($db) { $auto_bill_partial_invoices->chunk(40, function ($invoices) use ($db) {
foreach ($invoices as $invoice) { foreach ($invoices as $invoice) {
AutoBill::dispatch($invoice->id, $db); AutoBill::dispatch($invoice->id, $db);
} }
sleep(2); sleep(1);
}); });
$auto_bill_invoices = Invoice::query() $auto_bill_invoices = Invoice::query()
@ -133,12 +133,12 @@ class AutoBillCron
nlog($auto_bill_invoices->count()." full invoices to auto bill db = {$db}"); nlog($auto_bill_invoices->count()." full invoices to auto bill db = {$db}");
$auto_bill_invoices->chunk(400, function ($invoices) use ($db) { $auto_bill_invoices->chunk(40, function ($invoices) use ($db) {
foreach ($invoices as $invoice) { foreach ($invoices as $invoice) {
AutoBill::dispatch($invoice->id, $db); AutoBill::dispatch($invoice->id, $db);
} }
sleep(2); sleep(1);
}); });
} }