reduce queue job statement process qty

This commit is contained in:
Steve Ng
2023-10-16 20:06:01 +08:00
parent 829ea9ad17
commit f943abcacb
4 changed files with 20 additions and 7 deletions
@@ -22,6 +22,7 @@ use App\Http\Controllers\Controller;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use DateTime;
use App\Models\StatementTransaction;
class BankStatementController extends Controller
{
@@ -88,7 +89,9 @@ class BankStatementController extends Controller
public function rerun()
{
CreateBankStatementTransactionOwners::dispatch();
foreach (StatementTransaction::doesntMapStatement()->get()->chunk(30) as $key => $transaction) {
CreateBankStatementTransactionOwners::dispatch($transaction);
}
return redirect()->back()->with('success', 'Rerun triggered successfully');
}