about summary refs log tree commit diff
path: root/gn3/computations/streaming.py
diff options
context:
space:
mode:
Diffstat (limited to 'gn3/computations/streaming.py')
-rw-r--r--gn3/computations/streaming.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/gn3/computations/streaming.py b/gn3/computations/streaming.py
index 1cebde3..b5afb5b 100644
--- a/gn3/computations/streaming.py
+++ b/gn3/computations/streaming.py
@@ -14,7 +14,7 @@ def run_process(cmd, output_file, run_id):
            run_id: unique id to identify the process
 
       output:
-          Dict with the results o either success or failure.
+          Dict with the results for either success or failure.
     """
     try:
         # phase: execute the  rscript cmd
@@ -24,7 +24,7 @@ def run_process(cmd, output_file, run_id):
             stderr=subprocess.STDOUT,
         ) as process:
             for line in iter(process.stdout.readline, b""):
-                # phase: capture the stdout for eaching line allowing read and write
+                # phase: capture the stdout for each line allowing read and write
                 with open(output_file, "a+", encoding="utf-8") as file_handler:
                     file_handler.write(line.decode("utf-8"))
             process.wait()
@@ -39,16 +39,16 @@ def run_process(cmd, output_file, run_id):
 
 def enable_streaming(func):
     """Decorator function to enable streaming for an endpoint
-    Note: should be used only in an app context
+    Note: should only be used  in an app context
     """
     @wraps(func)
     def decorated_function(*args, **kwargs):
         run_id = request.args.get("id")
-        stream_ouput_file = os.path.join(current_app.config.get("TMPDIR"),
-                                         f"{run_id}.txt")
-        with open(stream_ouput_file, "w+", encoding="utf-8",
+        stream_output_file = os.path.join(current_app.config.get("TMPDIR"),
+                                          f"{run_id}.txt")
+        with open(stream_output_file, "w+", encoding="utf-8",
                   ) as file_handler:
             file_handler.write("File created for streaming\n"
                                )
-        return func(stream_ouput_file, *args, **kwargs)
+        return func(stream_output_file, *args, **kwargs)
     return decorated_function