#!/bin/bash # Python 3.14 + gevent fork κ²½κ³  μ–΅μ œ export GEVENT_NOWAITPID=1 export PYTHONWARNINGS="ignore::DeprecationWarning" CONFIGFILE="./config.yaml" COUNT=0 # πŸ”§ μ„œλ²„ μ‹œμž‘ 전에 ν”ŒλŸ¬κ·ΈμΈ μ—…λ°μ΄νŠΈ update_plugins() { PLUGINS_DIR="./data/plugins" if [ -d "$PLUGINS_DIR" ]; then for dir in "$PLUGINS_DIR"/*/; do if [ -d "$dir/.git" ]; then echo "Updating plugin: $dir" git -C "$dir" reset --hard HEAD 2>/dev/null git -C "$dir" pull 2>/dev/null & # 병렬 μ‹€ν–‰ fi done wait # λͺ¨λ“  git pull μ™„λ£Œ λŒ€κΈ° fi } # 첫 μ‹€ν–‰ μ‹œ λ˜λŠ” --update μ˜΅μ…˜μΌ λ•Œλ§Œ if [ "$COUNT" = "0" ]; then update_plugins fi while true; do python -m flaskfarm.main --repeat ${COUNT} --config ${CONFIGFILE} RESULT=$? echo "PYTHON EXIT CODE : ${RESULT}.............." if [ "$RESULT" = "1" ]; then echo 'REPEAT....' update_plugins # μž¬μ‹œμž‘ μ‹œμ—λ„ μ—…λ°μ΄νŠΈ else echo 'FINISH....' break fi COUNT=`expr $COUNT + 1` done