mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
Reduce touch events
This commit is contained in:
parent
67a7449ffc
commit
847c2cce66
@ -179,7 +179,7 @@ class ProcessMailgunWebhook implements ShouldQueue
|
||||
private function processOpen()
|
||||
{
|
||||
$this->invitation->opened_date = now();
|
||||
$this->invitation->save();
|
||||
$this->invitation->saveQuietly();
|
||||
|
||||
$sl = $this->getSystemLog($this->request['MessageID']);
|
||||
|
||||
@ -272,7 +272,7 @@ class ProcessMailgunWebhook implements ShouldQueue
|
||||
private function processDelivery()
|
||||
{
|
||||
$this->invitation->email_status = 'delivered';
|
||||
$this->invitation->save();
|
||||
$this->invitation->saveQuietly();
|
||||
|
||||
$sl = $this->getSystemLog($this->request['MessageID']);
|
||||
|
||||
@ -359,7 +359,7 @@ class ProcessMailgunWebhook implements ShouldQueue
|
||||
private function processBounce()
|
||||
{
|
||||
$this->invitation->email_status = 'bounced';
|
||||
$this->invitation->save();
|
||||
$this->invitation->saveQuietly();
|
||||
|
||||
$bounce = new EmailBounce(
|
||||
$this->request['event-data']['tags'][0],
|
||||
@ -433,7 +433,7 @@ class ProcessMailgunWebhook implements ShouldQueue
|
||||
private function processSpamComplaint()
|
||||
{
|
||||
$this->invitation->email_status = 'spam';
|
||||
$this->invitation->save();
|
||||
$this->invitation->saveQuietly();
|
||||
|
||||
$spam = new EmailSpam(
|
||||
$this->request['event-data']['tags'][0],
|
||||
|
@ -165,7 +165,7 @@ class ProcessPostmarkWebhook implements ShouldQueue
|
||||
private function processOpen()
|
||||
{
|
||||
$this->invitation->opened_date = now();
|
||||
$this->invitation->save();
|
||||
$this->invitation->saveQuietly();
|
||||
|
||||
$data = array_merge($this->request, ['history' => $this->fetchMessage()]);
|
||||
|
||||
@ -205,7 +205,7 @@ class ProcessPostmarkWebhook implements ShouldQueue
|
||||
private function processDelivery()
|
||||
{
|
||||
$this->invitation->email_status = 'delivered';
|
||||
$this->invitation->save();
|
||||
$this->invitation->saveQuietly();
|
||||
|
||||
$data = array_merge($this->request, ['history' => $this->fetchMessage()]);
|
||||
|
||||
@ -257,7 +257,7 @@ class ProcessPostmarkWebhook implements ShouldQueue
|
||||
private function processBounce()
|
||||
{
|
||||
$this->invitation->email_status = 'bounced';
|
||||
$this->invitation->save();
|
||||
$this->invitation->saveQuietly();
|
||||
|
||||
$bounce = new EmailBounce(
|
||||
$this->request['Tag'],
|
||||
@ -308,7 +308,7 @@ class ProcessPostmarkWebhook implements ShouldQueue
|
||||
private function processSpamComplaint()
|
||||
{
|
||||
$this->invitation->email_status = 'spam';
|
||||
$this->invitation->save();
|
||||
$this->invitation->saveQuietly();
|
||||
|
||||
$spam = new EmailSpam(
|
||||
$this->request['Tag'],
|
||||
|
@ -71,12 +71,10 @@ class ReminderJob implements ShouldQueue
|
||||
->whereHas('company', function ($query) {
|
||||
$query->where('is_disabled', 0);
|
||||
})
|
||||
->with('invitations')->chunk(800, function ($invoices) {
|
||||
foreach ($invoices as $invoice) {
|
||||
$this->sendReminderForInvoice($invoice);
|
||||
}
|
||||
|
||||
sleep(1);
|
||||
->with('invitations')
|
||||
->cursor()
|
||||
->each(function ($invoice) {
|
||||
$this->sendReminderForInvoice($invoice);
|
||||
});
|
||||
} else {
|
||||
//multiDB environment, need to
|
||||
@ -99,14 +97,11 @@ class ReminderJob implements ShouldQueue
|
||||
->whereHas('company', function ($query) {
|
||||
$query->where('is_disabled', 0);
|
||||
})
|
||||
->with('invitations')->chunk(800, function ($invoices) {
|
||||
|
||||
foreach ($invoices as $invoice) {
|
||||
$this->sendReminderForInvoice($invoice);
|
||||
}
|
||||
|
||||
sleep(1);
|
||||
});
|
||||
->with('invitations')
|
||||
->cursor()
|
||||
->each(function ($invoice) {
|
||||
$this->sendReminderForInvoice($invoice);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user