Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 06 22:51
    agronholm commented #465
  • Aug 06 12:41
    agronholm synchronize #608
  • Aug 03 14:30
    courtland opened #653
  • Aug 03 14:22
    agronholm commented #652
  • Aug 03 13:13
    courtland closed #652
  • Aug 03 13:13
    courtland commented #652
  • Aug 03 06:04
    asihacker commented #465
  • Aug 03 06:03
    asihacker commented #465
  • Aug 03 06:01
    asihacker commented #465
  • Aug 03 06:00
    asihacker commented #465
  • Aug 02 22:49
    agronholm commented #652
  • Aug 02 22:49
    agronholm commented #652
  • Aug 02 21:54
    courtland edited #652
  • Aug 02 21:53
    courtland edited #652
  • Aug 02 21:53
    courtland opened #652
  • Aug 02 13:31
    taybin commented #465
  • Aug 02 13:31
    taybin commented #465
  • Aug 02 08:35
    Jackeriss commented #465
  • Aug 02 08:20
    Jackeriss commented #465
  • Aug 01 21:47
    agronholm closed #641
Alex Grönholm
@agronholm
@kxrxkt_twitter give it the function object, don't call it
the () syntax calls the function
I mean, you didn't think x = foo() would assign the function object to x, did you?
kxrxkt
@kxrxkt_twitter
oh well i forgot that i don't need to actually call it
thanks for pointing that out
lalaipo
@lalaipo
how to run cron in certain day?

in aiocron i can use like this:
@aiocron.crontab('29 17 * * 3,6,0')

but how to do that in apscheduler?
like this?
@scheduler.scheduled_job('cron', hour='17', minutes='29', day_of_week='wed,sat,sun')

@agronholm
Alex Grönholm
@agronholm
apscheduler also supports the crontab syntax
lalaipo
@lalaipo
so how to set it to certain day?
Alex Grönholm
@agronholm
like, day of week?
lalaipo
@lalaipo
like this 3,6,0
Alex Grönholm
@agronholm
I do suggest using day names
lalaipo
@lalaipo
so it will be executed in wednesday ,saturday and sunday only
Alex Grönholm
@agronholm
well, like in your example
did you have a problem with that?
lalaipo
@lalaipo
so its valid?
i havent tried because i need to wait lol
Alex Grönholm
@agronholm
it is valid
lalaipo
@lalaipo
oh okay thanks
lalaipo
@lalaipo
why i got return plugin_cls(**constructor_kwargs) TypeError: __init__() got an unexpected keyword argument 'minutes'
oh its minute
lalaipo
@lalaipo
how to shutdown it? when i use await scheduler.shutdown() it works i checked it by scheduler.running return False but it gives me errors too: TypeError: object NoneType can't be used in 'await' expression, but when i use scheduler.shutdown() i checked it with scheduler.running it returns True it means not stopped by doing that
Alex Grönholm
@agronholm
@lalaipo that is an achilles heel of the current asyncio scheduler
it could not be made awaitable
in the master branch there is an unfinished 4.0 scheduler which has full async support
lalaipo
@lalaipo
oh okay
how do i import AsyncIOScheduler in master branch?
Alex Grönholm
@agronholm
@lalaipo do you know how to use git?
the documentation hasn't really been updated so you'd be on your own pretty much – the tests would be the only clues
lalaipo
@lalaipo
yes i use pip3 install git+git/repo@branch
in 3.7.0 i can import using from apscheduler.schedulers.asyncio import AsyncIOScheduler
but in master branch it doesnt work
Alex Grönholm
@agronholm
if you want to play around with 4.0
the documentation has not been updated yet
lalaipo
@lalaipo
oh ok
Alex Grönholm
@agronholm
pypy 3.7 is production quality now, so apscheduler 4 targeting py3.7+ seems to have been spot on
lalaipo
@lalaipo
can i add multiple times in cron expression? like hours='1,2'
@agronholm
Alex Grönholm
@agronholm
yes, have you read the docs for the cron trigger?
lalaipo
@lalaipo
i see only hours
Alex Grönholm
@agronholm
what do you mean?
lalaipo
@lalaipo
could it be combined with minutes?
i want it 11:30, 12:30
Alex Grönholm
@agronholm
you can use OrTrigger for that
combine two cron triggers
lalaipo
@lalaipo
image.png
how about this?
Alex Grönholm
@agronholm
that creates two separate jobs which is not the same thing
lalaipo
@lalaipo
hmm