Skip to content

Commit

Permalink
tweak(UpdatePlayerProfileStatsTask): logging / exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
roydejong committed Jan 12, 2024
1 parent 24901b0 commit fbdc45e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tasks/UpdatePlayerProfileStatsTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@

foreach ($pendingStats as $profileStats) {
if ($player = Player::fetch($profileStats->playerId)) {
$profileStats->recalculate($player);
try {
echo "Recalculating stats for player {$player->id}...\n";
$profileStats->recalculate($player);
} catch (Exception $ex) {
echo " >>> Error recalculating stats for player {$player->id}: {$ex->getMessage()}\n";
}
}
$runTime = microtime(true) - $startTime;
if ($runTime >= 59) {
Expand Down

0 comments on commit fbdc45e

Please sign in to comment.