Question: Can I see currently running jobs?
See original GitHub issueIssue Description
Is there a possibility to differentiate between a taskid that is currently running and just doesn’t exist? While it’s running, the taskid isn’t present in huey.all_results() and get(taskid) returns None. After completion it is present in all_results() and get(taskid) returns the result as expected.
Background: I’m writing an API where a post to endpoint A starts a task and I want to provide an endpoint B that allows polling of the task status. Now I would like to provide different status response for a plain invalid taskid and a currently running taskid.
I’m using sqlite for storage. Is that the cause? Or do I need to use signals and write to the sqlite?
Even more background on what i’m doing:
from flask import Flask, url_for
import worker
from huey import SqliteHuey
huey = SqliteHuey(filename='worker.db', fsync=True)
app = Flask(__name__)
@app.route("/create/<a>", methods=["POST"])
def create_task(a):
task = worker.create_hue_task(a)
return task.id, 204
@app.route("/allresults")
def allresults():
return str(huey.all_results())
import time
from huey import SqliteHuey
huey = SqliteHuey(filename='worker.db', fsync=True)
@huey.task()
def create_hue_task(a):
time.sleep(20)
return a+a
and then just start the worker and the app:
huey_consumer worker.huey
# in another shell
flask run
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
sql server - how to know status of currently running jobs
@GoldenLion, right-click on the job you ran and select job history. Then expand the failed job log. You can scroll down and see...
Read more >Script to see running jobs in SQL Server with Job Start Time
Show activity on this post. I posted a query a while back for getting a list of currently running jobs here. SELECT ja....
Read more >How to tell when a scheduled job is running
Answer: These views will show already currently running scheduled jobs: v$session; dba_scheduler_running_chains; dba_scheduler_running_jobs; v$ ...
Read more >How to see all jobs that are currently running - UiPath Forum
Is there a way to see all the active jobs at a global/tenant level ? You can find all configured Robots in Robots...
Read more >How to see Which all Scheduled jobs are running an...
How to see Which all Scheduled jobs are running and which all jobs failed ? Basically need to see current status for running...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Oh, I suppose if the operating system kills the worker process for using all the ram…but if that’s the case you’ve got bigger problems.
That’s actually been added. Bear in mind this only occurs if you hard shutdown the consumer. Graceful shutdown finishes all running tasks.
https://huey.readthedocs.io/en/latest/signals.html
See SIGNAL_INTERRUPTED