From 0f3ba2655ad0d3651a590a1a02983a0017a1bc6a Mon Sep 17 00:00:00 2001 From: HummyPkg Date: Thu, 20 Dec 2018 11:30:11 +0000 Subject: [PATCH] Use [nugget recordings] for status --- webif/cgi-bin/status.jim | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/webif/cgi-bin/status.jim b/webif/cgi-bin/status.jim index 3464a7dc..95389de2 100755 --- a/webif/cgi-bin/status.jim +++ b/webif/cgi-bin/status.jim @@ -66,6 +66,7 @@ proc get_data {} { set ret {} if {[catch {set data \ [exec /mod/webif/lib/bin/lsof -X -Fns -p $pid]} msg]} { + debug "Error: $msg" set ret {} } else { set size 0 @@ -99,6 +100,7 @@ proc get_data {} { set ret($file) -1 } } else { + debug "$file = $size" set ret($file) $size } } @@ -165,31 +167,17 @@ if {$type eq "full"} { } if {[llength $data]} { debug " DATA: ($data)" - if {![file exists /tmp/.rractive]} { + if {[system nuggeted]} { + set recs [lmap i [split [system nugget recordings] "\n"] { + function "$i.ts" + }] + debug " RECS: $recs" + set rr 1 + } else { sleep 3 set ndata [get_data] debug " NDATA: ($ndata)" set rr 0 - } else { - #sleep 1 - set ndata [get_data] - debug " NDATA: ($ndata)" - foreach k [array names data] { - if {![dict exists $ndata $k]} { - dict unset data $k - } - } - - set rr 1 - set recs {} - loop i 0 2 { - catch { - set fd [open "/tmp/.rec$i" r] - lappend recs "[$fd read -nonewline].ts" - $fd close - } - } - debug " RECS: $recs" } foreach file [array names data] { set bname [file rootname [file tail $file]]