Files
quality_recticel/py_app/stop_production.sh
Quality System Admin d264bcdca9 feat: Major system improvements and production deployment
 New Features:
- Added view_orders route with proper table display
- Implemented CSV upload with preview workflow and date parsing
- Added production WSGI server configuration with Gunicorn
- Created comprehensive production management scripts

🔧 Bug Fixes:
- Fixed upload_data route column mapping for actual CSV structure
- Resolved print module database queries and template rendering
- Fixed view orders navigation routing (was pointing to JSON API)
- Corrected barcode display width constraints in print module
- Added proper date format parsing for MySQL compatibility

🎨 UI/UX Improvements:
- Updated view_orders template with theme-compliant styling
- Hidden barcode text in print module preview for cleaner display
- Enhanced CSV upload with two-step preview-then-save workflow
- Improved error handling and debugging throughout upload process

🚀 Production Infrastructure:
- Added Gunicorn WSGI server with proper configuration
- Created systemd service for production deployment
- Implemented production management scripts (start/stop/status)
- Added comprehensive logging setup
- Updated requirements.txt with production dependencies

📊 Database & Data:
- Enhanced order_for_labels table compatibility
- Fixed column mappings for real CSV data structure
- Added proper date parsing and validation
- Improved error handling with detailed debugging

🔧 Technical Debt:
- Reorganized database setup documentation
- Added proper error handling throughout upload workflow
- Enhanced debugging capabilities for troubleshooting
- Improved code organization and documentation
2025-10-11 23:31:32 +03:00

69 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
# Production Stop Script for Trasabilitate Application
# This script stops the Gunicorn WSGI server
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
print_success() {
echo -e "${GREEN}$1${NC}"
}
print_warning() {
echo -e "${YELLOW}⚠️ $1${NC}"
}
print_error() {
echo -e "${RED}$1${NC}"
}
echo -e "${BLUE}🛑 Trasabilitate Application - Production Stop${NC}"
echo "=============================================="
PID_FILE="../run/trasabilitate.pid"
if [[ ! -f "$PID_FILE" ]]; then
print_warning "No PID file found. Server may not be running."
echo "PID file location: $PID_FILE"
exit 1
fi
PID=$(cat "$PID_FILE")
if ps -p "$PID" > /dev/null 2>&1; then
echo "Stopping Trasabilitate application (PID: $PID)..."
# Send SIGTERM first (graceful shutdown)
kill "$PID"
# Wait for graceful shutdown
sleep 3
# Check if still running
if ps -p "$PID" > /dev/null 2>&1; then
print_warning "Process still running, sending SIGKILL..."
kill -9 "$PID"
sleep 1
fi
# Check if process is finally stopped
if ! ps -p "$PID" > /dev/null 2>&1; then
print_success "Application stopped successfully"
rm -f "$PID_FILE"
else
print_error "Failed to stop application (PID: $PID)"
exit 1
fi
else
print_warning "Process $PID not found. Cleaning up PID file..."
rm -f "$PID_FILE"
print_success "PID file cleaned up"
fi
echo ""
print_success "Trasabilitate application has been stopped"