fix carbon 3 diffIn*

This commit is contained in:
xiaomlove
2025-01-19 23:41:50 +08:00
parent 943e960921
commit 9de6fb42a9
12 changed files with 20 additions and 21 deletions

View File

@@ -300,7 +300,7 @@ class ToolRepository extends BaseRepository
$start = Carbon::now();
try {
$remoteFilesystem->writeStream(basename($filename), $localFilesystem->readStream($filename));
$speed = !(float)$start->diffInSeconds() ? 0 :filesize($filename) / (float)$start->diffInSeconds();
$speed = !(float)abs($start->diffInSeconds()) ? 0 :filesize($filename) / (float)abs($start->diffInSeconds());
$log = 'Elapsed time: '.$start->diffForHumans(null, true);
$log .= ', Speed: '. number_format($speed/1024,2) . ' KB/s';
do_log($log);