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
Alex Grönholm
@agronholm
well you get whole job objects when you call get_jobs()
so just access the id attribute of each job
as for print_jobs(), I remember talking about that with someone
definitely something I will consider with apscheduler 4
Dave Eargle
@deargle
Hi, what is the expected behavior for jobs that are added tentatively, if the app shuts down without the scheduler ever starting? I'm also noticing that tentatively scheduled jobs cannot be serialized (getstate) because they don't necessarily have misfire_grace_time set.
I can open a github report for the second one, unless it's expected behavior
Also, to elaborate, I think I'm seeing that tentatively-added jobs disappear if the process ends -- they aren't tentatively added to any datastore, they're just added in-memory
Perhaps the workaround would be -- if the goal is to add jobs without ever running them within a given process, then start the scheduler but in a paused state, so that jobs get added to a datastore.
Dave Eargle
@deargle
my situation is that I'm trying to integrate apscheduler into a flask app which is sometimes multithreaded. If it's multithreaded, I don't want apscheduler to try to run jobs, but I do want users to be able to view scheduled jobs.
Aleksandr Lobanov
@anklav24
image.png

well you get whole job objects when you call get_jobs()

Thank you! That's what I was looking for.

Alex Grönholm
@agronholm
@deargle yeah...you will need a separate scheduler service to connect to for that
AlenPaulVarghese
@alenpaul2001
The examples provided with the repos are old?
Alex Grönholm
@agronholm
they are, yes
meaning not updated to v4.0
AlenPaulVarghese
@alenpaul2001
ok :)
alenpaul2001
@alenpaul2001:matrix.org
[m]

Is there any way to achieve the following:

every time the program starts, it checks the jobstore for an existing job with id. if the id is not present adds the job.

I cannot use replace_existing because it will replace the time as well.

Alex Grönholm
@agronholm
@alenpaul2001:matrix.org have you looked at get_job()?
AlenPaulVarghese
@alenpaul2001

@alenpaul2001:matrix.org have you looked at get_job()?

yeah that works for me, thank you again.

Shiv Kumar
@skagrawal10
Hi Guys,
I am using apscheduler in one of my project. I have scheduled one job every 5 min. but, What I am seeing here is that, it runs fine till 2-3 hours and then, it suddenly does not schedule jobs later in 5 min interval. There is not any log from the scheduler why it did not run next scheduled run.
Any thoughts where I can look into this?
Alex Grönholm
@agronholm
@skagrawal10 have you read the troubleshooting instructions in the documentation?
Shiv Kumar
@skagrawal10
Hi @agronholm , Thanks for responding. Can you please share me link of the troubleshooting instructions?
I tried various troubleshooting methods but none help.
Alex Grönholm
@agronholm
the troubleshooting instructions are at the bottom of the user guide
can you at least find the user guide on your own?
Shiv Kumar
@skagrawal10
Yes. I got the user guide and found troubleshooting instructions to add Logger. Let me do that.
Alberto Calvo Rubió
@AlbertoCalvoRubio
Hi! How can I avoid to create a new DB connection or similar(ampq connection to rabbitmq) on any callback function? I can't pass a SQLAlchemy Session as argument's callback because I am using SQLAlchemyJobStore and it is serialized. I hope you can help my, I'm working on my Computer's Science degree final project.
Alex Grönholm
@agronholm
@AlbertoCalvoRubio you could just store it as a module global?
or add a function that creates a new connection only when there is no existing connection
Alberto Calvo Rubió
@AlbertoCalvoRubio
Thank you! The simple solution and I had not thought of it
Suhrob Malikov
@malikovss
Hi there.
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?