Replies: 2 comments 4 replies
-
Hi, which version of apscheduler do you use? Do you mean a long running job, or a schedule for a job? In v4 you can do the following: The first one could be checked by looking for the job id in the output of from apscheduler import AsyncScheduler
from apscheduler.triggers.interval import IntervalTrigger
from time import sleep
def task():
sleep(10)
# Check jobs
async with AsyncScheduler() as sched:
id_ = await sched.add_job(task)
await sched.start_in_background()
jobs = await sched.get_jobs()
print(jobs)
# Check schedules
async with AsyncScheduler() as sched:
id_ = await sched.add_schedule(task, IntervalTrigger(seconds=30))
await sched.start_in_background()
scheds = await sched.get_schedules()
print(scheds) |
Beta Was this translation helpful? Give feedback.
0 replies
-
@legout I‘m using the V3.11.0 version, if run a long time async task, how to check if the job is running or not? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am developing an app where multiconcurrency is not an option.
I have a scheduled some jobs, which runs on a timer
I have a GUI where an user can manually run the job, but if it's already running I want to alert the user that the job is already running
But I haven't found in the documentation a way to understand if a job is running or not..
Are there any functions I can use to understand if this job is running?
Beta Was this translation helpful? Give feedback.
All reactions