import time
from django.core.management.base import BaseCommand
from myapp.apscheduler import attendance1

class Command(BaseCommand):
    help = 'Run APScheduler'

    def handle(self, *args, **kwargs):
        self.stdout.write('✅ Scheduler Starting...')
        attendance1()
        try:
            while True:
                time.sleep(60)
        except (KeyboardInterrupt, SystemExit):
            self.stdout.write('🛑 Stopped')
