pybit
pybit copied to clipboard
Add list of recently completed jobs to web front end
Would be useful to have a separate list of recently completed jobs (including failed jobs) as they disappear from the 'current jobs' list as soon as they have finished.
How to design this? We presumably don't want to modify the existing get_unfinished_jobs() query, as controller uses this.
We probably want a new query taking inspiration from get_unfinished_jobs() and get_job_statuses(), which gets all jobs where status is done, and where the latest status has a timestamp less than x time ago.
Not much of a SQL wizard, but im assuming we need to find out how to do DATEDIFFs in PostgreSQL, and SELECT where the timestamp is less than x minutes from Now() or whatever the function is to get CURRENT_TIMESTAMP.
To the documentation!
The key bit seems to be something like WHERE time >= (now() - interval '10 min')
We also need to add paging, and improve the Dashboard.