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.

0
votes
0answers
19 views

How to stop program from crashing while background scheduler is running?

I am drawing a face using opencv and then subsequently drawing a different face when a key is pressed ('s' for surprised face,'d' for sad face, 'a' for angry, etc.). I want my faces to simulate eyes ...
1
vote
1answer
39 views

Django.db.utils.OperationalError: (2013, 'Lost connection to MySQL server during query')

I'm using apschduler to call a task every 2hs, in this task it will read data from mysql db. But after mysql's default wait_timeout 28800s, it always raise Django.db.utils.OperationalError: (2013, '...
1
vote
0answers
20 views

how to extend 5 parameter expression to 7 parameter expression in cron statement

sched.add_job(job_function, CronTrigger.from_crontab('0 0 1-15 may-aug *')) The above expression is adding a five parameter cron expression, i have an expression like 0 0/1 * 1/1 * ? * which is ...
0
votes
0answers
16 views

BackgroundScheduler object has no attribute 'add_cron_job'

When I try to run my program I get "AttributeError: 'BackgroundScheduler' object has no attribute 'add_cron_job'" When the program should correctly run. Looking at the docs. It seems out of date. ...
0
votes
0answers
19 views

Scheduler is not running jobs

I have some code here as: from apscheduler.schedulers.background import BackgroundScheduler def myjob(): print('hello') scheduler = BackgroundScheduler() scheduler.start() scheduler.add_job(myjob,...
0
votes
1answer
71 views

Failed to establish a new connection error

I'm working on a web scraping program and meet some problems. And raise a MaxRetry Error: raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: ...
0
votes
1answer
13 views

APScheduler and zerorpc incompatibility

It looks like that scheduling jobs with APScheduler doesn't go along with ZeroRPC. When testing using test(x) ZeroRPC works well. When starting with run() the scheduler repeatedly returns the ...
1
vote
1answer
22 views

Apscheduler has no triggers listed

I am currently trying to setup a scheduler (using apscheduler), and it fails when adding a job: from apscheduler.schedulers.blocking import BlockingScheduler def job(): print('hello world') ...
0
votes
0answers
21 views

Blocking scheduler to schedule an interval job

I am trying to schedule a job to run scripts every 15 days using the blocking scheduler. However, it is not working and is not showing any results. When I comment out the scheduler line it works and ...
0
votes
1answer
28 views

Unable to restore job - apscheduler, sqlalchemy

I'm trying to write my own little python flask app to monitor the hard drives of my server. But since now, I'm getting trouble using the sqljobstore of apscheduler. While the server is running, ...
1
vote
0answers
15 views

Can't get attribute 'CronTrigger'

Unable to restore job "b'30'" -- removing it Traceback (most recent call last): File "/opt/py3/lib64/python3.6/site-packages/apscheduler/jobstores/redis.py", line 131, in _reconstitute_jobs jobs....
0
votes
0answers
57 views

APScheduler not executing as expected

I have a couple of custom modules which are being called from clock.py running apscheduler: Problem caused by APScheduler apscheduler keeps inserting the same date over and over at scheduled ...
0
votes
0answers
25 views

Heroku app not running scheduled task overnight

I've made a sitespeed tracker / database app on Heroku. It takes urls added by the user and runs them through a sitespeed tool's api (GTmetrix), storing the results in a postgreSQL database. Using ...
0
votes
1answer
20 views

Read a file at a fixed interval using apscheduler [duplicate]

I want to read a file line by line and output each line at a fixed interval . The purpose of the script is to replay some GPS log files whilst updating the time/date fields as the software I'm ...
1
vote
0answers
34 views

How to get all jobs running on TornadoScheduler?

I am using TornadoScheduler of APScheduler python package and trying to get current running jobs. Job configuration: ... scheduler = TornadoScheduler() def job(): while True: print('...
0
votes
0answers
51 views

Jobs are not being stored in the database after add_job() has been called

I'm trying to use Flask-APScheduler to run some delayed jobs and after setup and running the app it successfully creates jobs table in Postgres database but does not save jobs there after add_job() ...
0
votes
0answers
19 views

In the APScheduler, job is not trigger on the end date

We are using APScheduler==3.5.1 in Flask app. Gave start date and end date to the scheduler which having one day difference. e.g. start date is 3-4-2019 and end date is 4-4-2019. Time to trigger the ...
1
vote
2answers
101 views

How to access return value from apscheduler?

I can't quite piece together how to access the return values from scheduled jobs in apscheduler. The job needs to run at a different time each day, and I need the return value from today's job to ...
0
votes
1answer
51 views

Unable to update GeoJSON files in an application using APScheduler on Heroku

I have 2 GeoJSON files in my application. I have written a Python job using APScheduler to update the 2 GeoJSON files based on the changes in the database. The job is configured to run once every 24 ...
0
votes
2answers
81 views

Is there a way to run python flask function, every specific interval of time and display on the local server the output?

I am working python program using flask, where i want to extract keys from dictionary. this keys is in text format. But I want to repeat this above whole process after every specific interval of time. ...
0
votes
1answer
46 views

python flask scheduling: all workers start scheduler task

I use scheduled tasks inside a flask application: import time import atexit from apscheduler.schedulers.background import BackgroundScheduler def intervall(): with app....
0
votes
1answer
16 views

apsheduler separation of concerns breaks it

My mental model on how this application should work is to be able to separate the process that calls add_job to the one that sits manages the process. When I add the job before starting the schedule ...
0
votes
1answer
117 views

django-apscheduler schedule a job to run at a specific time of the day

There isn't much available in the https://github.com/jarekwg/django-apscheduler . I want to set a job which will run exactly at 12:00 AM each day. How to set that up in django-apscheduler? What I ...
1
vote
1answer
82 views

APScheduler:Trigger New job after completion of previous job

I'm using APScheduler(3.5.3) to run three different jobs. I need to trigger the second job immediately after the completion of first job. Also I don't know the completion time of first job.I have set ...
0
votes
0answers
74 views

Python APScheduler not shutting down cleanly

I'm trying to use apscheduler to collect images for some number of hours and then shut down. The following code runs and then shuts down but throws an exception in the process. I'm taking the ...
0
votes
0answers
49 views

Why does apscheduler not work in uwsgi mode?

I have a flask application. This application mimics routing of vehicles in a city and when a vehicle reaches a designated point, I have to wait for 30-180 seconds before starting it again. I am trying ...
0
votes
0answers
15 views

Heroku SQLAlchemyJobStore config

I am trying to config some persistence scheduled jobs using SQLAlchemyJobStore in a Django 2.x app hosted in Heroku. job_stores = { 'default': SQLAlchemyJobStore(url=settings....
0
votes
1answer
28 views

python apschedular RedisJobStore not storing jobs in redis cache

That is my python code: All jobs are triggering at right time but not stored as redis cache. If restart the program, cannot schedule pending jobs. What I am doing wrong? from apscheduler.jobstores....
1
vote
1answer
41 views

Python3 + Gunicon 19.9 + Django 2.0 does not print my logs, but print django.request

I added a lot of logs to my django app, but non is printed.. My logs are printed to std when I do not use gunicorn (just manage.py runserver ) python manager.py runserver log : 2019-02-22 16:36:...
0
votes
0answers
21 views

Cron jobs run late after previous job fails

I am trying to run a job every second after every 5 minute time mark e.g. 10:00:01,10:05:01 etc with the python code below. For the most part the jobs run on time, but in some cases after a job fails (...
1
vote
2answers
92 views

How to repeatedly run a python script from another python script?

I want to repeatedly run 2 python script every 10 seconds from another script. I have a python file with the following statement:- test1.py print("this is test1") test2.py print("this is test2") ...
1
vote
1answer
212 views

Scheduling a cron job in python to run a python script every day at 10 am through APSCHEDULER

I want to schedule a cron job in python that runs a python script every day at 10 am. I am using apscheduler to achieve this functionality. I am trying to use apscheduler functionality to schedule a ...
0
votes
1answer
35 views

APScheduler resets after every deploy

I have a script which which when run adds rss feed parsing tasks to some celery queues. Now I have implemented apscheduler to run the script every 2 hours to get new data from the feeds. My ...
0
votes
0answers
12 views

How to store details for each execution of a job

I'm building a simple Flask application which users would use to submit jobs and check the results. As the jobs are going to be expensive calculations, my idea is to simply submit a task to Celery and ...
0
votes
1answer
78 views

How can I get the latest data from APScheduler through sqlalchemy?

I try to use Advanced Python Scheduler to get data from my MySql database through flask sqlalchemy once per every five seconds. As far as I am concerned, I want to fetch the latest modified data from ...
0
votes
1answer
174 views

“RuntimeError: Working outside of application context ” with Python Flask app ( Sending gmail using scheduler )

app = Flask(__name__) app.config.update( MAIL_SERVER = 'smtp.gmail.com', MAIL_PORT = 465, MAIL_USE_SSL = True, MAIL_USE_TLS = False, MAIL_USERNAME = '******', MAIL_PASSWORD = '...
0
votes
1answer
51 views

apscheduler calling function params only once

I have tweaked this basic example to illustrate the point in the subject: https://github.com/agronholm/apscheduler/blob/master/examples/executors/processpool.py Here is the tweaked code(see args=[...
0
votes
1answer
68 views

APScheduler listener, don't work asyncio.ensure_future

Tell me, where I am wrong? I create a TornadoScheduler in the context of a Tornado server. Assign a listener and a execute function. But I get not exactly what I need. from tornado.concurrent import ...
0
votes
0answers
33 views

How to prevent open files error when using APScheduler/Flask on server

I'm using the APScheduler library with Flask to run tasks on an Ubuntu server. It will run fine for several days, but eventually the Flask process will error out with the following message: (libdev) ...
0
votes
0answers
31 views

Apscheduler running on multiple servers, Job should start only one in one instance

I have below scheduler job written in Django framework. I am using a job store to store all job and execution details in SQL DB. Below is my scheduler code. I have my Django app running on 5 instances/...
0
votes
0answers
53 views

apscheduler cron job is not executing

I am using apscheduler with a persistent job store through sqlalchemy in a flask application. flask-sqlalchemy module is being used. Jobs without triggers and a persistent job store are executing. ...
0
votes
1answer
115 views

APScheduler. What is the best practices to shutdown schedulers with any non memory storage?

I need to run scheduler distributed to many machines and has one single point to store jobs. I use redis for this purposes and my code looks like this: jobstores = {'default': {'type': 'redis'}} ...
0
votes
1answer
80 views

XLWings can't connect to excel workbook when run as a scheduled task through APScheduler

I'm trying to access an excel workbook every minute to save data that it's currently displaying from a different program. When the scheduler gets to accessing the workbook, I'm getting "OSError: [...
1
vote
0answers
144 views

Django APScheduler not executing jobs according to schedule with Apache and mod_wsgi

I have a Django project that uses django-apscheduler with the following configuration: Apache virtualhost WSGIPassAuthorization On WSGIScriptAlias / /some/app/wsgi.py WSGIDaemonProcess some-app \ ...
1
vote
1answer
219 views

APScheduler and passing arguments

I am using APScheduler to automate my script every 10 minutes for now. It stops executing after the print("[+] Success! Bot Starting!"), it does not output an error. I suggest my declaration of ...
0
votes
0answers
220 views

Saving a model to the database in Django

I am new to django and have been working on a project for a few weeks now. I am making a django application that I host on heroku. I want to schedule a task. The end goal is to make a series of API ...
0
votes
0answers
104 views

Apscheduler+scrapy signal only works in main thread

i want to combine apscheduler with scrapy.but my code is wrong. How should i modify it? settings = get_project_settings() configure_logging(settings) runner = CrawlerRunner(settings) @defer....
1
vote
1answer
71 views

APscheduler and Pyramid python

I'm trying to use the wonder apscheduler in a pyarmid api. The idea is to have a background job run regularly, while we still query the api for the result from time to time. Basically I use the job in ...
0
votes
0answers
76 views

it is not working using flask_apscheduler in flask withoud reload

i am trying to schedule tasks within my flask app, it is not working as intended, no errors when i set processes = 2 but processes = 1 is ok.why? the code like this: #--coding:utf-8 --*-- import sys ...
0
votes
0answers
91 views

APScheduler OCCASIONAL TypeError: can't pickle module objects

This is a OCCASIONAL Error. I can not reproduce it exactly. After APScheduler running for a couple of hours, It may occurs. I change the source code(apscheduler/schedulers/base.py) to get more detail: ...