Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Sep 18 09:10
    agronholm closed #549
  • Sep 18 09:10
    agronholm commented #549
  • Sep 18 07:59
    coolsnake opened #549
  • Sep 18 07:59
    coolsnake labeled #549
  • Sep 15 19:41
    sea72 edited #548
  • Sep 15 19:40
    sea72 edited #548
  • Sep 15 19:39
    sea72 edited #548
  • Sep 15 19:39
    sea72 edited #548
  • Sep 15 19:39
    sea72 opened #548
  • Sep 15 10:03
    agronholm commented #547
  • Sep 15 01:25
    ZhangYupengCHY opened #547
  • Sep 12 22:15
    agronholm commented #465
  • Sep 12 22:08
    agronholm edited #465
  • Sep 12 22:07

    agronholm on master

    Implemented one-shot event subs… Switched tests to Python 3.10 s… Removed debugging code and 1 more (compare)

  • Sep 12 12:19

    agronholm on master

    Improved the event subscription… Added context manager support t… Guard subscriptions in the sync… (compare)

  • Sep 11 22:48

    agronholm on master

    Reduced the number of job compl… Refactored event brokers to use… (compare)

  • Sep 11 20:09

    agronholm on master

    Applied pytest-lazy-fixture to … Applied the external_service ma… (compare)

  • Sep 11 18:37
    agronholm commented #465
  • Sep 11 18:37

    agronholm on master

    Use the real UUID column type w… Serialize top level attributes … Converted more classes to use a… and 4 more (compare)

  • Sep 10 16:59
    axuy commented #546
Liananas
@LianeB
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
Alex Grönholm
@agronholm
:ok_hand:
Albert Xu
@axuy
hi, is there any way to change the start method of a process in the ProcessPoolExecutor? It looks like it defaults to "fork" on unix and it's causing memory issues for me. It would be great if I could pass in mp_context https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.ProcessPoolExecutor to underlying ProcessPool here: https://github.com/agronholm/apscheduler/blob/e77e9339c675fcc30a9f6ae85dbd0b1a7b13427f/apscheduler/executors/pool.py#L64. Is there any way to achieve similar functionality currently?
nubonics
@nubonics
hi there, so im trying to schedule coroutines with apscheduler.qtscheduler, but im having some difficulties, as it does not await the coro. heres the simplest code i can provide to show what im trying to do: code + traceback @ https://bpa.st/PNFA
孙晓光
@phpsxg

def my_listener(event):
if event.exception:
print('The job crashed :(')
else:
print('The job worked :)')

scheduler.add_listener(my_listener, EVENT_JOB_EXECUTED | EVENT_JOB_ERROR)

添加了add_listener,但是当任务执行时没有输出The job work 是什么原因
Aaron
@aaw_gitlab

Hi, anyone know what exactly "The target callable must be globally accessible" mean? failed add a job from GUI of django, here's error described

<Unable to restore job 'jobs.tick'. Removing it...>

Alex Grönholm
@agronholm
@aaw_gitlab the current release of apscheduler requires that the target function of a job is available on unpickling