mirror of
https://github.com/unraid/webgui.git
synced 2025-12-30 22:20:23 -06:00
Add -m1 to file_line grep for performance
Stop after first match to avoid processing entire file
This commit is contained in:
@@ -167,7 +167,7 @@ function parse_rsync_progress($status, $action_label) {
|
||||
// obtain filename line like:
|
||||
// "/mnt/disk6/images/image.jpg"
|
||||
// note: -v is used to obtain the opposite of the progress line regex and to filter out empty lines
|
||||
$file_line = exec("tac $status | grep -v -E '(^\$|^ .*[0-9]+%.*[0-9]+:[0-9]+:[0-9]+)' | tr -s ' ' || echo ''");
|
||||
$file_line = exec("tac $status | grep -m1 -v -E '(^\$|^ .*[0-9]+%.*[0-9]+:[0-9]+:[0-9]+)' | tr -s ' ' || echo ''");
|
||||
if ($file_line) {
|
||||
$text[0] .= htmlspecialchars(mb_strimhalf($file_line, 70, '...'), ENT_QUOTES, 'UTF-8');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user