Calendario/run_dev.sh
Murilo Scolari 573152a3f0
Some checks are pending
CI / test (push) Waiting to run
Initial commit of StudyCalendar
2026-09-16 20:00:04 -03:00

34 lines
820 B
Bash
Executable file

#!/bin/bash
# Script para rodar o StudyCalendar em modo de desenvolvimento
# Define variáveis de ambiente
export APP_ENV=development
export DATABASE_PATH=/tmp/studycalendar-dev.db
echo "Iniciando o servidor web e o agendador em background..."
# Inicia o servidor web em background
venv/bin/python app.py &
WEB_PID=$!
# Inicia o agendador em background
venv/bin/python scheduler_process.py &
SCHEDULER_PID=$!
# Função para encerrar os dois processos ao apertar Ctrl+C
cleanup() {
echo ""
echo "Encerrando os processos..."
kill $WEB_PID
kill $SCHEDULER_PID
wait $WEB_PID 2>/dev/null
wait $SCHEDULER_PID 2>/dev/null
echo "Processos encerrados."
exit 0
}
# Captura o sinal de interrupção (Ctrl+C)
trap cleanup SIGINT SIGTERM
# Mantém o script rodando e aguarda os processos
wait