about summary refs log tree commit homepage
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/dtas-readahead14
1 files changed, 9 insertions, 5 deletions
diff --git a/bin/dtas-readahead b/bin/dtas-readahead
index f02bc35..798a5b4 100644
--- a/bin/dtas-readahead
+++ b/bin/dtas-readahead
@@ -190,12 +190,16 @@ begin
     end
     idx or break
     cur = YAML.load(c.req('current'))
-    cur['current'] or break
+    current = cur['current'] or break
+  end
+  if current
+    elapsed = DTAS.now - t0
+    p [:elapsed, elapsed]
+    timeout = 5 - elapsed
+    timeout = 0 if timeout < 0
+  else
+    timeout = nil
   end
-  elapsed = DTAS.now - t0
-  p [:elapsed, elapsed]
-  timeout = 5 - elapsed
-  timeout = 0 if timeout < 0
   r = wait_read(w, timeout)
   p w.res_wait if r
 rescue EOFError