Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Conversation

Copy link

Copilot AI commented Nov 17, 2025

Implements a cron job to automatically sync data from Life-USTC/static cache into the database every 6 hours (00:00, 06:00, 12:00, 18:00 UTC).

Changes

  • src/crontab - Cron schedule: 0 0,6,12,18 * * *
  • src/Dockerfile.cron - Dedicated image with cron daemon, git (for repo cloning), and Django dependencies. Entrypoint pipes environment vars to /etc/environment so cron jobs inherit DB credentials and Django settings.
  • docker-compose.yml / docker-compose.prod.yml - Added cron service that shares database network with web service
  • .github/workflows/docker-build-push-cron.yml - CI/CD to build and push ghcr.io/life-ustc/server-cron:latest

Usage

# Development
docker-compose up

# Production  
docker-compose -f docker-compose.prod.yml up

# View logs
docker-compose logs -f cron

The cron container runs indefinitely with tail -f /var/log/cron.log, outputting job execution logs to stdout.

Original prompt

set python manage.py load_from_static to be a cronjob running 4 times per day


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add cron job to run load_from_static four times daily Add cron service to run load_from_static 4x daily Nov 17, 2025
Copilot AI requested a review from tiankaima November 17, 2025 14:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants