updated process send eve mail job

updated test command to work on resposne codes
This commit is contained in:
2021-03-16 01:00:02 +09:00
parent 85d39b867b
commit 61224e5611
4 changed files with 218 additions and 12 deletions
+22 -5
View File
@@ -49,11 +49,28 @@ class Test extends Command
*/
public function handle()
{
$helper = new FinanceHelper;
$esiHelper = new Esi;
$config = config('esi');
$startTime = time();
$receipt = $helper->GetApiWalletJournal(1, $config['primary']);
$endTime = time();
var_dump($endTime - $startTime);
$refreshToken = $esiHelper->GetRefreshToken($config['primary']);
$esi = $esiHelper->SetupEsiAuthentication($refreshToken);
try {
$response = $esi->setBody([
'approved_cost' => 100,
'body' => "Welcome to this test message.",
'recipients' => [[
'recipient_id' => $config['primary'],
'recipient_type' => 'character',
]],
'subject' => 'Just a Test',
])->invoke('post', '/characters/{character_id}/mail/', [
'character_id' => $config['primary'],
]);
} catch(RequestFailedException $e) {
return null;
}
dd($response);
}
}
@@ -55,6 +55,7 @@ class MiningTaxesInvoices extends Command
$lookup = new LookupHelper;
$config = config('esi');
$task = new CommandHelper('MiningTaxesInvoices');
$mailDelay = 15;
//Set the task as started
$task->SetStartStatus();
@@ -125,7 +126,7 @@ class MiningTaxesInvoices extends Command
$recipient = $charId;
//Send the Eve Mail Job to the queue to be dispatched
ProcessSendEveMailJob::dispatch($body, $recipient, $recipientType, $subject, $sender)->onQueue('mail');
ProcessSendEveMailJob::dispatch($body, $recipient, $recipientType, $subject, $sender)->onQueue('mail')->delay(Carbon::now()->addSeconds($mailDelay));
//Save the invoice model
$invoice = new Invoice;
@@ -147,6 +148,9 @@ class MiningTaxesInvoices extends Command
'invoiced' => 'Yes',
'invoice_id' => $invoiceId,
]);
//update the delay
$mailDelay = $mailDelay + 20;
}
//Set the task as stopped