diff options
| author | Alexander_Kabui | 2025-01-09 10:43:21 +0300 |
|---|---|---|
| committer | Alexander_Kabui | 2025-01-09 10:43:21 +0300 |
| commit | f73605a67d3521e9a5cea86bdd5a947cf574f061 (patch) | |
| tree | 4574bbee0fa7928efbf8ada1dc0bb5713d01fa3d | |
| parent | 4e63aa2246c2f3ca6c09c284f7f78b896fe0e33b (diff) | |
| download | genenetwork3-f73605a67d3521e9a5cea86bdd5a947cf574f061.tar.gz | |
refactor: enhance docstring for streaming endpoint.
| -rw-r--r-- | gn3/api/streaming.py | 8 |
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, |
