Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jul 29 09:10
    agronholm commented #533
  • Jul 28 17:02
    williamhatcher opened #533
  • Jul 28 11:05
    agronholm labeled #532
  • Jul 28 09:03
    CGpythoner closed #532
  • Jul 28 09:03
    CGpythoner commented #532
  • Jul 27 07:33
    agronholm commented #532
  • Jul 27 01:31
    CGpythoner opened #532
  • Jul 26 21:18
    agronholm labeled #531
  • Jul 26 21:17
    sachoker closed #531
  • Jul 26 21:17
    sachoker commented #531
  • Jul 26 21:16
    agronholm commented #531
  • Jul 26 21:16
    agronholm commented #531
  • Jul 26 21:13
    sachoker opened #531
  • Jul 21 11:50
    agronholm commented #530
  • Jul 21 09:58
    sprototles commented #530
  • Jul 21 09:42
    agronholm commented #529
  • Jul 21 09:39
    agronholm commented #530
  • Jul 21 09:38
    sprototles commented #530
  • Jul 21 09:34
    sprototles commented #530
  • Jul 21 08:48
    agronholm commented #530
Suhrob Malikov
@malikovss
on startup I do scheduler.remove_jobs() but missed jobs not stopping. what should I do? get_jobs() returning nothing
Suhrob Malikov
@malikovss
How can I remove missed jobs. If I don't know their ids
Alex Grönholm
@agronholm
@malikovss I'm not sure what you're asking – if get_jobs() returns nothing then there are no jobs to stop from being scheduled
as far as the already running ones go, there's nothing you can do about those
Liananas
@LianeB
image.png
Hi! I'm using APScheduler for a discord bot with discord.py. I'm getting the error PicklingError: Can't pickle <function Voting.ping at 0x0000028435A024C0>: it's not the same object as cogs.voting.Voting.ping It basically doesn't recognize my command functions (I have a ping function it doesn't recognize, but if i comment it out it doesn't recognize my next command). I've been trying to save the jobs to a database, there was no error before I added that part of code. Does anyone know what's causing this? Thanks :)
Liananas
@LianeB
image.png
I moved the code around and this seemed to have solved the error (I took the scheduler related functions outside of the class). However I'll need to access variables in my class eventually, is there a way so the scheduler functions work inside of my class, or they absolutely have to be outside?
Yusuf_M_Thon_iD
@Sunda001
hemlo
AsyncIOScheduler(job_defaults={'misfire_grace_time': 15*60}) is this the right way to add misfire ?
Alex Grönholm
@agronholm
@LianeB can you make the class instance available as a module global?
@Sunda001 yes
Liananas
@LianeB
@agronholm I'm working with Discord.py, I'm not sure how it works in its backend, but I never need to manually instance my cogs (classes)
Could my func method work someway inside my class?
Alex Grönholm
@agronholm
@LianeB you must understand how jobs work when stored in a database
a reference to the function or method is stored, along with all the arguments, and that includes self
if self is not pickled and unpickled, where would it come from?
the obvious way to work around this is to use a memory store instead of a database
Liananas
@LianeB
@agronholm Thanks for the explanation! I ended up finding a work-around to what I was trying to do and I kept my func outside of the class :)
I have another question; I am using MongoDBJobStore, is there a way to add additional fields to the documents that store jobs when I create a new job?
Alex Grönholm
@agronholm
@LianeB only by subclassing the job store class
(or writing your own based on the existing one)
shahrooz
@shahrooz1397

hey guys
im using apscheduler
and i have this:
schd.add_job(func, kwargs={'hello:23, 'hi':'hey'}, id=jobid, trigger=trigger, seconds=int(seconds))

now if i want to reschedule/modify the job how should i change that kwargs values?

schd.reschedule_job(jobid, kwargs={'hello':hii, 'hi':'hello})

i did this but it didnt work

shahrooz
@shahrooz1397
TypeError: init() got an unexpected keyword argument 'kwargs'
mohit.gorakhapuriya
@mohit.gorakhapuriya:matrix.org
[m]
Hi, @agronholm i am getting this 'TypeError: can't pickle _thread.RLock objects
' error. Can you help me ?
Alex Grönholm
@agronholm
@mohit.gorakhapuriya:matrix.org have you read the FAQ?
you're probably using a persistent job store and trying to add a job that contains an unpickleable argument
Ashok
@ashokdhudla
@agronholm i am implementing django-apscheduler. its working fine except one case.
@agronholm how would i track missed jobs in django-apscheduler library
@agronholm Jobs are created successfully and executed as expected but if any jobs missed due to system down how we can schedule missed jobs ?
Ashok
@ashokdhudla

when I restarted application it was just logging out a lot of messages saying this job was missed since the time I stopped app

Did you get any solution for this?

Yusuf_M_Thon_iD
@Sunda001
hv u tried misfire_grace_time
2 replies
Alex Grönholm
@agronholm
@ashokdhudla yeah it sounds like you need to adjust the misfire grace time of those jobs
14 replies
turli
@fanandli
why do django_apscheduler_djangoexecution create two identical records at the same time??help ..thanks
Alex Grönholm
@agronholm
@fanandli you should ask that of the people who made django_apscheduler (who are not here)
Sven Varkel
@svenvarkel
hi! First, thanks for great library, @agronholm
2nd I have a question about add_listener(). It seems that even I have instantiated AsyncScheduler whenever I use add_listener(<async callback method>) the callback is executed synchronously. Is there any way to make event listeners that have been added to AsyncScheduler, async also?
funny thing is - I cannot find any hint of add_listener method from the APScheduler code that I checked out from GitHub :)
also, add_listener() being sync is an artifact of the old design which is going away in v4.0 (master)
the listener system has not been replaced there yet
Albert Xu
@axuy
hi guys has anyone dealt with memory leaks using apscheduler? It looks like the threads in my threadpool/processpool executor are retaining some kind of garbage after the job has finished. The jobs are reading in large pandas DataFrames from csvs and doing some transformations. Are there any gotcha's I'm missing? Also is there any way to gracefully restart a worker thread/process after it has finished?
Alex Grönholm
@agronholm
@axuy are you using both?
which python version? older versions don't use workers very efficiently
Albert Xu
@axuy
no, just one or the other but i'm observing leaky behavior for both. I'm using 3.6.11
Alex Grönholm
@agronholm
yes, that's a fairly old version
I think it got improved around v3.8
Albert Xu
@axuy
I see I will try to run my app with a newer version and check for improvement
thanks for the support and the library