add: queue total ETA from current encode speed
The queue card now shows an estimated time to clear: current job remaining + sum(pending source durations) / current speed. Durations come from a path+mtime-keyed cache that probes each file once in the background (ffprobe format=duration, header-only), so the 1s poll never re-probes; entries are pruned to the live queue. No speed (idle/held) -> no estimate; files still being probed mark it partial (shown as '~Xh+'). Closes #9
This commit is contained in:
+6
-1
@@ -113,7 +113,12 @@ func main() {
|
||||
}
|
||||
|
||||
if addr := *cfg.HTTPAddr; addr != "" {
|
||||
srv := &http.Server{Addr: addr, Handler: server.New(tracker, log, store, controls, cfg.Paths.Input, cfg.Paths.Failed).Handler()}
|
||||
probeDuration := func(p string) (float64, error) {
|
||||
pctx, pcancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer pcancel()
|
||||
return enc.GetDuration(pctx, p)
|
||||
}
|
||||
srv := &http.Server{Addr: addr, Handler: server.New(tracker, log, store, controls, probeDuration, cfg.Paths.Input, cfg.Paths.Failed).Handler()}
|
||||
go func() {
|
||||
log.Info(fmt.Sprintf("Status server listening on %s", addr))
|
||||
if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed {
|
||||
|
||||
Reference in New Issue
Block a user