Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Nov 28 20:01
    pre-commit-ci[bot] synchronize #677
  • Nov 28 20:01
    pre-commit-ci[bot] edited #677
  • Nov 28 20:01

    pre-commit-ci[bot] on pre-commit-ci-update-config

    [pre-commit.ci] pre-commit auto… (compare)

  • Nov 21 17:39
    euri10 opened #681
  • Nov 20 11:55
    agronholm commented #680
  • Nov 20 05:38
    cepheidev edited #680
  • Nov 20 05:38
    cepheidev edited #680
  • Nov 20 05:37
    cepheidev labeled #680
  • Nov 20 05:37
    cepheidev opened #680
  • Nov 18 09:51
    euri10 closed #679
  • Nov 18 09:44
    euri10 opened #679
  • Nov 16 17:12
    agronholm commented #362
  • Nov 16 13:54
    rafrafek commented #362
  • Nov 14 19:17
    pre-commit-ci[bot] synchronize #677
  • Nov 14 19:17
    pre-commit-ci[bot] edited #677
  • Nov 14 19:17

    pre-commit-ci[bot] on pre-commit-ci-update-config

    [pre-commit.ci] pre-commit auto… (compare)

  • Nov 11 21:21
    agronholm commented #666
  • Nov 11 21:21
    agronholm commented #666
  • Nov 11 21:12

    agronholm on 3.9.0.post2

    Dropped Python 2.7 from the lis… (compare)

  • Nov 11 21:07

    agronholm on 3.9.1.post1

    Dropped Python 2.7 from the lis… (compare)

Naga Venkatesh Gavini
@venkateshgavini_twitter
each job can complete is 1 second, because job function is just to make an API call
Alex Grönholm
@agronholm
so they're essentially network related jobs? just waiting on sockets?
Naga Venkatesh Gavini
@venkateshgavini_twitter
Yes alex
Alex Grönholm
@agronholm
I don't see a problem then
Naga Venkatesh Gavini
@venkateshgavini_twitter
Okay thanks alex
Alex Grönholm
@agronholm
1 GB of memory seems a bit tight
when running a database server on the same box
just thinking out loud
@venkateshgavini_twitter just so long as you don't try to use multiple schedulers on the same store
that only works on apscheduler 4 which does not even have a prerelease out yet
Naga Venkatesh Gavini
@venkateshgavini_twitter
My database will be on a seperate box and I use only one scheduler
So no issues then, but I will do load test once
Alex Grönholm
@agronholm
no problem then if there's no db on that box
Naga Venkatesh Gavini
@venkateshgavini_twitter
Thanks
Konstantin Pankov
@c0nst_float_gitlab
Hello again!
I was here a mouth ago) We decided to make architectural changes into our project. Digged the Dramatiq and SQS out. And now we are using AsyncIOScheduler with in-memory job-store. And before every scheduler launch, loads data for tasks from DB and form tasks. Now - everything is pretty good.
But there is one question: how is it possible to make a gracefull shutdown with waiting for currently running jobs in event_loop? scheduler.shutdown(wait=True)
Alex Grönholm
@agronholm
sadly there isn't – this is one of the shortcomings of the 3.x architecture
no proper async support
4.0 on the other hand has first class async support but it hasn't even reached its first prerelease yet
but you can experiment with the current master branch
basics should be working
Konstantin Pankov
@c0nst_float_gitlab

Sadly, sadly... Will try to come up with something to solve the problem.

I will describe our gracefull shutdown use case, maybe it will help in the development of version 4.0

1) Shutdown scheduler (stop scheduling new jobs)
2) Wait until all tasks are completed
3) Force exit if after 15 seconds if there is still uncompleted tasks (cause, there could be tasks that runs for some minutes)
4) Close DB and HTTP session pools

kxrxkt
@kxrxkt_twitter
hello. i would like to ask help for my problem. when i start the scheduler it succesfully calls the function and then throws an error at me:
TypeError: func must be a callable or a textual reference to one
i cant figure this out
Alex Grönholm
@agronholm
@kxrxkt_twitter are you maybe adding your job like this? scheduler.add_job(yourfunc(), ...)?
kxrxkt
@kxrxkt_twitter
image.png
@agronholm yes
Alex Grönholm
@agronholm

ok so consider the following:

def foo():
    return 1

print(foo())

What argument do you expect print() to be called with?

kxrxkt
@kxrxkt_twitter
the argument for print() here is func foo()
and?
oh
which gives 1
so do you mean that function does it jobs and on second iteration gives nothing
then how do i put the function itself into scheduler?
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