Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jun 29 07:07
    agronholm commented #632
  • Jun 29 07:06
    agronholm commented #632
  • Jun 26 21:13
    agronholm commented #465
  • Jun 26 13:32
    cfaaron commented #465
  • Jun 26 10:42
    kai-tub commented #465
  • Jun 26 09:59
    agronholm commented #465
  • Jun 26 09:35
    agronholm closed #582
  • Jun 26 09:35
    agronholm commented #582
  • Jun 25 21:50
    martinzarza opened #639
  • Jun 25 17:26
    agronholm closed #636
  • Jun 25 02:41
    mohit-blazop commented #636
  • Jun 24 21:23
    stepacool commented #285
  • Jun 22 15:18
    Munanga commented #332
  • Jun 21 07:21
    agronholm commented #638
  • Jun 21 05:33
    4n1qz5skwv commented #638
  • Jun 21 05:33
    4n1qz5skwv commented #638
  • Jun 21 05:21
    agronholm closed #638
  • Jun 21 05:21
    agronholm commented #638
  • Jun 21 04:56
    4n1qz5skwv opened #638
  • Jun 19 18:21
    agronholm commented #636
Alex Grönholm
@agronholm
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
how then
Alex Grönholm
@agronholm
like I said, with OrTrigger
make two CronTrigger instances and combine them with OrTrigger
lalaipo
@lalaipo
there is no docs about it?
lalaipo
@lalaipo
i use search it keeps loading
Alex Grönholm
@agronholm
yes
lalaipo
@lalaipo
image.png
am i right?
Alex Grönholm
@agronholm
no, you're supposed to use OrTrigger, not AndTrigger
lalaipo
@lalaipo
ah okay
lalaipo
@lalaipo
image.png
any ideas?
Alex Grönholm
@agronholm
what's the problem?
what are you trying to accomplish?
Vioshim
@Vioshim
Hello people, I've been testing the master branch, and realized that AsyncIOScheduler isn't there, is that module getting removed, deprecated or something?
Alex Grönholm
@agronholm
@Krangelj there are two schedulers now, AsyncScheduler and SyncScheduler
you want to use AsyncScheduler
Vioshim
@Vioshim
Oh I see, all right I'll try to check how that one works, seems it doesn't use .start()
Alex Grönholm
@agronholm
I suggest you look at the tests because the docs haven't been updated yet
Vioshim
@Vioshim

Made some small changes in my code and now it works as usual, basically add_schedule rather than add_job along with not having to make a .start()

But, thanks it worked.

Alex Grönholm
@agronholm
:thumbsup:
Vioshim
@Vioshim
image.png

Morning

also btw, is there a way to use an AsyncScheduler without using async with ?

I was randomly play testing and discovered that this is apparently the only way to replicate old .start() behavior

Alex Grönholm
@agronholm
it is currently the only way – if you have a convincing case against it, please present it so I can take that into account in the design
Vioshim
@Vioshim

I see, well I work on a discord bot (chat bot), in which it executes itself in a different loop, then in commands, we usually add events to make the bot keep executing those Scheduler functions without interrupting the main execution, hence why in my code I can't use the async with due to it being functions that make callbacks to existing elements.

For example, in the older Apscheduler, this is how I used to do stuff there

Alex Grönholm
@agronholm
where are you starting the scheduler?
Vioshim
@Vioshim
I'll fix the pic, it has some issues ^^;