Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
slatinsky committed Aug 14, 2024
2 parents 8cf1da3 + a208f1c commit 9e51db0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/RUN_DEV.bat
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if not exist "_temp\mongodb\" mkdir "_temp\mongodb\"

@REM start the scripts
start wt --maximized -d %~dp0\dcef\backend\fastapi cmd /k "..\..\..\_temp\fastapi\venv\Scripts\python.exe" dev.py; ^
split-pane -V -d %~dp0\dcef\backend\preprocess cmd /k nodemon -e py --ignore "__pycache__" --exec "..\..\..\_temp\preprocess\venv\Scripts\python.exe" main_mongo.py; ^
split-pane -V -d %~dp0\dcef\backend\preprocess cmd /k nodemon -e py --ignore "__pycache__" --exec "..\..\..\_temp\preprocess\venv\Scripts\python.exe" main_mongo.py windows; ^
move-focus left; ^
split-pane -H -d %~dp0\dcef\frontend cmd /k npm run dev; ^
move-focus right; ^
Expand Down
2 changes: 1 addition & 1 deletion src/dcef.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def runner(name, args, cwd):

def start_preprocess():
cwd = os.path.realpath(BASE_DIR + '/dcef/backend/preprocess')
args = ['dcefpreprocess.exe']
args = ['dcefpreprocess.exe', 'windows']
th = threading.Thread(target=runner, args=('preprocess', args, cwd), daemon=False)
th.start()
return th
Expand Down
2 changes: 1 addition & 1 deletion src/dcef/backend/docker/run_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ mkdir -p /dcef/cache/preprocess
mkdir -p /dcef/cache/db
mongod --dbpath "/dcef/cache/db/" --wiredTigerCacheSizeGB 1.5 &
cd /dcef/backend/preprocess
python3.11 main_mongo.py
python3.11 main_mongo.py docker
cd /dcef/backend/fastapi
python3.11 prod.py &
echo "############################################################"
Expand Down
15 changes: 14 additions & 1 deletion src/dcef/backend/preprocess/main_mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,22 @@ def main(input_dir):
print("preprocess done")


def print_help():
print("Usage: python main.py <docker|windows>")

if __name__ == "__main__":
input_dir = "../../../exports/"
if len(sys.argv) != 2:
print_help()
sys.exit(1)

if sys.argv[1] == "windows":
input_dir = "../../../exports/"
elif sys.argv[1] == "docker":
input_dir = "/dcef/exports/"
else:
print_help()
sys.exit(1)

with Timer("Preprocess"):
main(input_dir)

0 comments on commit 9e51db0

Please sign in to comment.