Ryan Walters 47c23459f1 refactor: implement comprehensive graceful shutdown across all services
Implements graceful shutdown with broadcast channels and proper timeout handling
for scraper workers, scheduler, bot service, and status update tasks. Introduces
centralized shutdown utilities and improves service manager to handle parallel
shutdown with per-service timeouts instead of shared timeout budgets.

Key changes:
- Add utils module with shutdown helper functions
- Update ScraperService to return errors on shutdown failures
- Refactor scheduler with cancellable work tasks and 5s grace period
- Extract worker shutdown logic into helper methods for clarity
- Add broadcast channel shutdown support to BotService and status task
- Improve ServiceManager to shutdown services in parallel with individual timeouts
2025-11-03 02:10:01 -06:00
2025-09-13 18:52:23 -05:00

banner

A complex multi-service system providing a Discord bot and browser-based interface to UTSA's course data.

Services

The application consists of three modular services that can be run independently or together:

  • Discord Bot (bot)

    • Primary interface for course monitoring and data queries
    • Built with Serenity and Poise frameworks for robust command handling
    • Uses slash commands with comprehensive error handling and logging
  • Web Server (web)

    • Axum-based server with Vite/React-based frontend
    • Embeds static assets at compile time with E-Tags & Cache-Control headers
  • Scraper (scraper)

    • Intelligent data collection system with priority-based queuing inside PostgreSQL via sqlx
    • Rate-limited scraping with burst handling to respect UTSA's systems
    • Handles course data updates, availability changes, and metadata synchronization

Quick Start

pnpm install -C web  # Install frontend dependencies
cargo build  # Build the backend

just dev # Runs auto-reloading dev build
just dev --services bot,web # Runs auto-reloading dev build, running only the bot and web services
just dev-build # Development build with release characteristics (frontend is embedded, non-auto-reloading)

just build # Production build that embeds assets

Documentation

Comprehensive documentation is available in the docs/ folder.

Description
No description provided
Readme 1.9 MiB
Languages
Rust 88.5%
TypeScript 8.4%
Dockerfile 1.1%
Just 0.8%
JavaScript 0.6%
Other 0.6%