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
0
votes
1 answer

apscheduler Lost connection to MySQL server during query

I use apscheduler to execute regular job, and I got some error on it. "Lost connection to MySQL server during query" To find the answer, I try some test on it, and found out if my database(MySQL) "wait_timeout" is less than schedule interval time…
shan kuo
  • 1
  • 1
  • 4
0
votes
1 answer

Verifying that an APScheduler task has properly executed

I'm trying to use the APScheduler library to execute a job at two certain times: 1am PST and 2am PST. Sort of lost, I am trying to figure out what am doing wrong. Here is my code so far: #!/usr/bin/python import sys import re import urllib import…
user2578013
  • 73
  • 2
  • 4
  • 12
0
votes
0 answers

Apsheduler is executing job twice after removing the job with same id

I am experiencing that my job is executed twice when i remove a job from apsheduler and then add another job with same job id. if sched.get_job(str(id)) is not None: if schedule=='minutely': sched.modify_job(str(id), lambda:…
Rajat Vij
  • 689
  • 1
  • 6
  • 12
0
votes
1 answer

scheduled jobs function is called multiple times in APScheduler library in python

I have got unexpected behaviour in apscheduler library in python. here I have a simple code to call the basic function as: import sys from time import sleep from datetime import datetime from apscheduler.scheduler import Scheduler import…
Laxmi Kadariya
  • 1,103
  • 1
  • 14
  • 34
0
votes
1 answer

Python BackgroundScheduler program crashing when ran from another module

I am trying to build a application that will run a bash script every 10 minutes. I am using apscheduler to accomplish this and when i run my code from terminal it works like clock work. However when i try to run the code from another module it…
Ada
  • 97
  • 1
  • 11
0
votes
2 answers

APScheduler run async function in Tornado Python

I am trying to develop a small app which will gather weather data from an API. I have used APScheduler to execute the function every x minutes. I use Python Tornado framework. The error I am getting is: INFO Job "GetWeather (trigger:…
user3159821
  • 87
  • 2
  • 11
0
votes
2 answers

Problems with APScheduler in Google App Engine(Python 2.7)

I am new to Google App Engine. The APScheduler works perfectly fine for a simple code in python. But when uploaded to the GAE, it shows continuous loading with no response. import webapp2 import sys import time def my_job(text): …
aakash
  • 13
  • 3
0
votes
1 answer

How to force apscheduler to add jobs to the job store?

I'm adding a job to a scheduler using apscheduler using a script. Unfortunately, the job is not properly scheduled when using a script as I didn't start the scheduler. scheduler = self.getscheduler() # initializes and returns…
Raghu Venmarathoor
  • 858
  • 11
  • 28
0
votes
1 answer

apscheduler scheduler timeout

i have a problem regarding to pythons' apscheduler. i'm running a task that includes pulling data from db. The dbs' response time varies, because of different operations on it, from different sources, and predicting when the dbs' response time will…
gCoh
  • 2,719
  • 1
  • 22
  • 46
0
votes
1 answer

How to log APScheduler warnings with more information?

I'm using the Python APScheduler to run a bunch of recurring tasks, but for a couple tasks I now get errors such as: WARNING:apscheduler.scheduler:Execution of job "getAndStoreExchangeRate (trigger: cron[minute='*'], next run at: 2014-11-06…
kramer65
  • 50,427
  • 120
  • 308
  • 488
0
votes
1 answer

python time instance inside class not updating on call

I have a small script that polls a database to look for status of certain jobs. I decided to use APScheduler to handle the looping call. I created a decorator to timeout a function if taking too long. The issue I am having here is that the…
Ptrkcon
  • 1,455
  • 3
  • 16
  • 32
0
votes
1 answer

apscheduler not working . Import Error: No module named Scheduler found

I am getting import error while I am trying to run my code. Scheduler module is not found. when I tried bypassing the error by using backgroundScheduler(), I found it doesn't support cron-like job scheduling i.e add_cron_job. Where am I going wrong…
peepee
  • 21
  • 1
  • 2
0
votes
1 answer

APScheduler store job in custom database of mongodb

I want to store the job in mongodb using python and it should schedule on specific time. I did googling and found APScheduler will do. i downloaded the code and tried to run the code. It's schedule the job correctly and run it, but it store the job…
rajub
  • 320
  • 1
  • 5
  • 17
0
votes
2 answers

Best way to keep Python script running?

I'm using APScheduler to run some recurring tasks as follows: from apscheduler.scheduler import Scheduler from time import time, sleep apsched = Scheduler() apsched.start() def doSomethingRecurring(): pass # Do something really interesting…
kramer65
  • 50,427
  • 120
  • 308
  • 488
0
votes
1 answer

copying rather than modifying a job (APScheduler)

I'm writing a database-driven application with APScheduler (v3.0.0). Especially during development, I find myself frequently wanting to command a scheduled job to start running now without affecting its subsequent schedule. It's possible to do this…
Dan Lenski
  • 76,929
  • 13
  • 76
  • 124