Skip to content

Commit

Permalink
Fix division by zero. (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeykalenyuk authored Aug 25, 2021
1 parent 471e9af commit c8b249b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion migrateSessions.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@

$reasons = ($expired || $noData ? " ($expired expired, $noData no data)" : '');
if ($test) {
printf("Can migrate %d of %d sessions%s. Compressed from %d to %d (%.5f%% savings) in %.5f seconds\n", $migrated, $i, $reasons, $beforeSize, $afterSize, (($beforeSize-$afterSize)/$beforeSize)*100, $elapsedTime);
printf("Can migrate %d of %d sessions%s. Compressed from %d to %d (%.5f%% savings) in %.5f seconds\n", $migrated, $i, $reasons, $beforeSize, $afterSize, $beforeSize == 0 ? 0 : (($beforeSize-$afterSize)/$beforeSize)*100, $elapsedTime);
} else {
printf("Migrated %d of %d session files in %.5f seconds%s\n", $migrated, $i, $elapsedTime, $reasons);
Mage::app()->cleanCache(Mage_Core_Model_Config::CACHE_TAG);
Expand Down

0 comments on commit c8b249b

Please sign in to comment.