for clarification, I'm using the database driver. And when this eventually completes (even 3 months worth), my shifts, playbyplays, and game summaries tables are all completely done correctly. I simply cannot access the job_batches table even right now while this isn't even executing. If I do it for only 2 weeks back, I can, and I can watch the progress of the jobs and batches in real time. Thanks.
Job Batches Hanging
Hello everyone. I can't seem to find this specific issue previously.. my apologies if this was discussed already.
I'm new to jobs and batching. My app works fine without jobs, but obviously isn't ideal as the user waits a while. The task is basically iterating through each day and processing nhl hockey games per day. If I do this for a few days, zero issues (with jobs and batches). If I do this for longer than a month, things get dicey. Yesterday, I started receiving "no more storage on device" errors in my sentry. So I destroyed the 50gb hdd server on Forge and created a new one with 900 gb. Much better, but.. I still cannot access my job_batches table as it hangs forever and it only has 240 records. I can, however, access other tables with thousands of records no problem.
Am I doing jobs incorrectly? Do I need to manage storage or caching or something else that I'm not doing that's causing this? Below is the code where the "magic" happens.
Thanks in advance.
public function importPlayByPlaysByDate(string $date)
{
$games = $this->getGamesByDate($date);
$jobsPlayByPlay = [];
$jobsShifts = [];
$sumGames = [];
foreach($games['games'] as $game) {
$playByPlay = $this->getPlayByPlay($game['id']);
$jobsPlayByPlay[] = new ImportGamePlayByPlaysJob($playByPlay);
$shifts = $this->shiftsImporter->getShifts($game['id']);
$jobsShifts[] = new ImportShiftsJob($shifts);
$sumGames[] = new SumGameJob($playByPlay);
//create the game summary
//$this->sumGame($playByPlay);
//append season statistics, including averages and /60s
}
Bus::chain([
$batPlayByPlays = Bus::batch($jobsPlayByPlay)->name('Import Play By Plays - ' . $date),
$batShifts = Bus::batch($jobsShifts)->name('Import Shifts - ' . $date),
$batSums = Bus::batch($sumGames)->name('Summarize Games - ' . $date)
])->dispatch();
}
Please or to participate in this conversation.