[Python] How can keep apscheduler executer in different app and adding job in different app

Discussão em 'Python' iniciado por Stack, Agosto 13, 2025.

  1. Stack

    Stack Membro Participativo

    I am adding job in django application which can add job in MySQL jobstore using SqlAlchemy.

    I want apscheduler to run in the job in different application(using background apscheduler)

    Few problems I am facing.

    1. jobs are running in same application where i am adding job which is issue job requires heavy compute and it has nothing to do withapplication
    2. if I don't start scheduler It doesn't save job in jobstore and keeps it in pending jobs
    3. even If I start new scheduler in new application . sometime it deleltes job forcefully from MYSQL if any kind of issue found in job.
    4. Even I wrote custom sheduler changes done in code below,

    with self._jobstores_lock:
    if self.state == STATE_STOPPED:
    self._pending_jobs.append((job, jobstore, replace_existing))
    self._logger.info('Adding job tentatively -- it will be properly scheduled when '
    'the scheduler starts')
    else:
    self._real_add_job(job, jobstore, replace_existing)

    Continue reading...

Compartilhe esta Página