mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2025-03-16 07:02:22 +00:00
Merge branch 'master' of github.com:Mintplex-Labs/anything-llm
This commit is contained in:
commit
3c844363fb
1 changed files with 2 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
|||
import os
|
||||
from flask import Flask, json, request
|
||||
from scripts.watch.process_single import process_single
|
||||
from scripts.watch.filetypes import ACCEPTED_MIMES
|
||||
|
@ -7,7 +8,7 @@ WATCH_DIRECTORY = "hotdir"
|
|||
@api.route('/process', methods=['POST'])
|
||||
def process_file():
|
||||
content = request.json
|
||||
target_filename = content.get('filename')
|
||||
target_filename = os.path.normpath(content.get('filename')).lstrip(os.pardir + os.sep)
|
||||
print(f"Processing {target_filename}")
|
||||
success, reason = process_single(WATCH_DIRECTORY, target_filename)
|
||||
return json.dumps({'filename': target_filename, 'success': success, 'reason': reason})
|
||||
|
|
Loading…
Add table
Reference in a new issue