GitHub Actions commited on
Commit
09751b8
·
1 Parent(s): c294db9

deploy: sync from GitHub facd3886b22089e9158175b9656a8e49cd1b5879

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -87,10 +87,12 @@ def upload_files():
87
  session_id = session['id']
88
  files = request.files.getlist('files')
89
  upload_dir = Path(app.config['UPLOAD_FOLDER']) / session_id
 
90
  # clear out any existing files for the session
91
  if upload_dir.exists():
92
  shutil.rmtree(upload_dir)
93
  upload_dir.mkdir(parents=True, exist_ok=True)
 
94
  # generate new unique filenames via uuid, save the mapping dict of old:new to session
95
  filename_map = {}
96
  uuid_map_to_uuid_imgname = {}
@@ -165,6 +167,9 @@ def process_single_image(img_path, results_dir):
165
  @app.route('/process', methods=['POST'])
166
  def start_processing():
167
  session_id = session['id']
 
 
 
168
  job_state = {
169
  "status": "starting",
170
  "progress": 0,
 
87
  session_id = session['id']
88
  files = request.files.getlist('files')
89
  upload_dir = Path(app.config['UPLOAD_FOLDER']) / session_id
90
+ print(f"DEBUG /uploads: session_id={session_id}, upload_dir={upload_dir}")
91
  # clear out any existing files for the session
92
  if upload_dir.exists():
93
  shutil.rmtree(upload_dir)
94
  upload_dir.mkdir(parents=True, exist_ok=True)
95
+ print(f"DEBUG /uploads: dir created, exists={upload_dir.exists()}")
96
  # generate new unique filenames via uuid, save the mapping dict of old:new to session
97
  filename_map = {}
98
  uuid_map_to_uuid_imgname = {}
 
167
  @app.route('/process', methods=['POST'])
168
  def start_processing():
169
  session_id = session['id']
170
+ upload_dir_check = Path(app.config['UPLOAD_FOLDER']) / session_id
171
+ print(f"DEBUG /process: session_id={session_id}, upload_dir={upload_dir_check}, exists={upload_dir_check.exists()}")
172
+ print(f"DEBUG /process: /tmp/nemaquant/uploads contents={list(Path(app.config['UPLOAD_FOLDER']).iterdir()) if Path(app.config['UPLOAD_FOLDER']).exists() else 'UPLOAD_FOLDER missing'}")
173
  job_state = {
174
  "status": "starting",
175
  "progress": 0,