File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 3131# Redistribution and use in source and binary forms, with or without
3232# modification, are permitted provided that the following conditions are met:
3333#
34+ from tempfile import TemporaryDirectory
35+
3436from flask import request , Response
3537from flask_restful import Resource
3638from servicex_codegen .code_generator import CodeGenerator
@@ -44,14 +46,15 @@ def make_api(cls, code_generator: CodeGenerator):
4446
4547 def post (self ):
4648 try :
47- code = request .data .decode ('utf8' )
48- zip_data = self .code_generator .generate_code (code )
49+ with TemporaryDirectory () as tempdir :
50+ code = request .data .decode ('utf8' )
51+ zip_data = self .code_generator .generate_code (code , cache_path = tempdir )
4952
50- # Send the response back to you-know-what.
51- response = Response (
52- response = zip_data ,
53- status = 200 , mimetype = 'application/octet-stream' )
54- return response
53+ # Send the response back to you-know-what.
54+ response = Response (
55+ response = zip_data ,
56+ status = 200 , mimetype = 'application/octet-stream' )
57+ return response
5558 except BaseException as e :
5659 print (str (e ))
5760 import traceback
You can’t perform that action at this time.
0 commit comments