Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flush hits when no activity from stdin #368

Open
wants to merge 1 commit into
base: 5.x-dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions import_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import os.path
import queue
import re
import select
import ssl
import sys
import threading
Expand Down Expand Up @@ -2506,6 +2507,13 @@ def filtered_line(line, reason):
hits = []
lineno = -1
while True:
has_line = lambda f: select.select([f, ], [], [], 0.0)[0]
if os.name == 'posix' and file == sys.stdin and not has_line(file):
Recorder.add_hits(hits)
hits = []
time.sleep(1)
continue

line = file.readline()
if not line: break
lineno = lineno + 1
Expand Down
Loading