Questions tagged [apscheduler]

Advanced Python Scheduler (APScheduler) is a light but powerful in-process task scheduler that lets you schedule functions (or any other python callables) to be executed at times of your choosing.

Introduction

Advanced Python Scheduler (APScheduler) is a light but powerful in-process task scheduler that lets you schedule functions (or any other python callables) to be executed at times of your choosing.

This can be a far better alternative to externally run cron scripts for long-running applications (e.g. web applications), as it is platform neutral and can directly access your application’s variables and functions.

The development of APScheduler was heavily influenced by the Quartz task scheduler written in . APScheduler provides most of the major features that Quartz does, but it also provides features not present in Quartz (such as multiple job stores).

Features

  • No (hard) external dependencies
  • Thread-safe API
  • Excellent test coverage (tested on 2.4 - 2.7, 3.1 - 3.2, 2.5.2, 1.4.1 and 1.5)
  • Configurable scheduling mechanisms (triggers):
    • -like scheduling
    • Delayed scheduling of single run jobs (like the UNIX at command)
    • Interval-based (run a job at specified time intervals)
  • Multiple, simultaneously active job stores:

Reference

740 questions
11
votes
5 answers

How do I schedule an interval job with APScheduler?

I'm trying to schedule an interval job with APScheduler (v3.0.0). I've tried: from apscheduler.schedulers.blocking import BlockingScheduler sched = BlockingScheduler() def my_interval_job(): print 'Hello World!' sched.add_job(my_interval_job,…
Troy
  • 21,172
  • 20
  • 74
  • 103
10
votes
3 answers

Pyinstaller 3.3.1 & 3.4.0-dev build with apscheduler

Greeting! I'm trying to make a build using PyInstaller. Config: Python 3.6.5 pip 10.0.1, OS: Ubuntu 18.04. Using virtualenv (also tried with python -m venv). My app using an apscheduler, websocket, _thread and it seems like some related modules…
user1935987
  • 3,136
  • 9
  • 56
  • 108
10
votes
2 answers

Apscheduler runs once then throws TypeError

I'm trying to add a list of someone's soundcloud followers to a database every hour. I have the code working to pull their list of followers and add them to a db, but I run into errors when I use it with apscheduler. Here's an example of the…
Kyle Frye
  • 113
  • 1
  • 1
  • 4
10
votes
2 answers

Would starting APScheduler in a uwsgi app end up with one scheduler for each worker?

I have a flask application in which I need the scheduling feature of APScheduler. The question is: Where do I start the scheduler instance? I use uwsgi+nginx to serve this application with multiple workers, wouldn't I end up with multiple instances…
Will
  • 1,989
  • 20
  • 19
9
votes
0 answers

Apscheduler skipping job executions due to maximum number of instances

I am trying to use APScheduler to run periodic jobs with an IntervalTrigger, I've intentionally set the maximum number of running instances to one because I don't want jobs to overlap. Problem is that after some time the scheduler starts reporting…
8
votes
5 answers

RuntimeError: cannot schedule new futures after interpreter shutdown

I'm programming a python robot in the telegram, but I have an error that is not resolved, the error is in the schedule Traceback (most recent call last): File…
Vinicius Eduardo
  • 81
  • 1
  • 1
  • 2
8
votes
2 answers

Job is not performed by APScheduler's BackgroundScheduler

I have a Django application that I'm running on Docker. I'm trying to launch an APScheduler scheduler when I run the docker container. I created a scheduler and I simply added it a job that I called test1, and that sends an email to my address. This…
Jacques Ung
  • 157
  • 2
  • 6
8
votes
2 answers

How can I set limit to the duration of a job with the APScheduler?

I set the scheduler with the "max_instances=10".There can be 10 jobs to run concurrently.Sometimes some jobs blocked, it wsa hanging there.When more than 10 jobs werr blocking there, the exception of "skipped: maximum number of running instances…
hunknownz
  • 91
  • 1
  • 4
7
votes
1 answer

How to set hour range and minute interval using APScheduler

I'm trying to create a process that can run jobs on a cron schedule of 0/5 8-17 * * 1-5 and here is my test code: import argparse from apscheduler.schedulers.background import BackgroundScheduler import datetime import time cmdline_parser =…
BugCatcherJoe
  • 487
  • 3
  • 17
7
votes
2 answers

Run Job every 4 days but first run should happen now

I am trying to setup APScheduler to run every 4 days, but I need the job to start running now. I tried using interval trigger but I discovered it waits the specified period before running. Also I tried using cron the following way: sched =…
PepperoniPizza
  • 8,842
  • 9
  • 58
  • 100
7
votes
2 answers

Memory usage not getting lowered even after job is completed successfully

I have a job added in apscheduler which loads some data in memory and I am deleting all the objects after the job is complete. Now if I run this job with python it works successfully and memory drop after process exits successfully.But in case of…
Advay Umare
  • 432
  • 10
  • 23
7
votes
4 answers

APScheduler - ImportError: No module named 'apscheduler'

I don't know why I get this error: ImportError: No module named 'apscheduler'. I tried to install the older version with: sudo pip uninstall apscheduler and then sudo pip install apscheduler==2.1.2 but this doesn't worked for me. Here's my code:…
Pietro Ariano
  • 113
  • 1
  • 2
  • 12
7
votes
1 answer

Can we limit APScheduler to run 100 times only?

I am using APScheduler to run a python method in every 5 minutes. It's working perfectly. I need to limit the scheduled job iteration to 100. After the 100 iteration it should close the process. I have checked the reference document but I am unable…
Roopendra
  • 7,674
  • 16
  • 65
  • 92
7
votes
2 answers

Advance python scheduler 'tuple' object has no attribute 'public' while starting the scheduler

Starting the scheduler gives this error. As i can see in the commits that this piece of code was added just 3 days back. So am i missing something here or its a bug ? In /local/lib/python2.7/site-packages/apscheduler/__init__.py in () 1) #…
ashish jain
  • 101
  • 6
7
votes
2 answers

How to pass UTC timezone for APScheduler 3.0?

Any Heroku folks on here? It seems their system will not execute things from APScheduler labeled as cron. FYI: I'm using the free package. Using this example, the interval will run, the cron will not. Has anyone else run into this? EDIT: Its been…
mishap_n
  • 578
  • 2
  • 10
  • 23
1
2
3
49 50