aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gn3/api/streaming.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/gn3/api/streaming.py b/gn3/api/streaming.py
index 213d97f..355d903 100644
--- a/gn3/api/streaming.py
+++ b/gn3/api/streaming.py
@@ -10,13 +10,15 @@ streaming = Blueprint("stream", __name__)
@streaming.route("/<identifier>", methods=["GET"])
def stream(identifier):
- """ This endpoints streams stdout from a file expects
- the indetifier to be the file """
+ """ This endpoint streams stdout from a file.
+ It expects the indetifier to be the filename
+ in the TMPDIR created at the main computation
+ endpoint see example api/rqtl."""
output_file = os.path.join(current_app.config.get("TMPDIR"),
f"{identifier}.txt")
seek_position = int(request.args.get("peak", 0))
with open(output_file, encoding="utf-8") as file_handler:
- # read to the last position default to 0
+ # read from the last read position default to 0
file_handler.seek(seek_position)
results = {"data": file_handler.readlines(),
"run_id": identifier,