diff options
| author | Alexander_Kabui | 2024-11-22 12:37:49 +0300 |
|---|---|---|
| committer | Alexander_Kabui | 2024-11-22 12:54:32 +0300 |
| commit | a408abf9539de083c0d58b002c647ab67c2c622d (patch) | |
| tree | 177562ce4252fc940b0dd68fce1ad25eb86df5c5 /gn3/api | |
| parent | 9773b216d1f92111e2ba9f4f77e78b2ba64ce5f1 (diff) | |
| download | genenetwork3-a408abf9539de083c0d58b002c647ab67c2c622d.tar.gz | |
feat: return pointer position from where the file was last read.
Diffstat (limited to 'gn3/api')
| -rw-r--r-- | gn3/api/rqtl2.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gn3/api/rqtl2.py b/gn3/api/rqtl2.py index 03cf340..cc857da 100644 --- a/gn3/api/rqtl2.py +++ b/gn3/api/rqtl2.py @@ -6,6 +6,7 @@ import os from flask import current_app from flask import jsonify from flask import Blueprint +from flask import request rqtl2 = Blueprint("rqtl2", __name__) @@ -42,9 +43,11 @@ def compute(): def stream(indetifier): """ This endpoints streams stdout from a file expects the indetifier to be the file """ + # add seek position to this output_file = os.path.join(current_app.config.get("TMPDIR"), f"{indetifier}.txt") # raise error if file does not exist with open(output_file) as file_handler: - # rethink how we do the read should this be stream / yield ???? - return jsonify({"data": file_handler.readlines()}) + # rethink how we do the read should this be stream / yield/peak ???? + return jsonify({"data": file_handler.readlines(), + "pointer": file_handler.tell()}) |
