summaryrefslogtreecommitdiff
path: root/lorry-controller-remove-old-jobs
Commit message (Collapse)AuthorAgeFilesLines
* lorry-controller-remove-old-jobs: Filter out jobs started too recentlyBen Hutchings2020-09-151-1/+13
| | | | | | | | | Job IDs are assigned sequentially, and jobs cannot finish before they start. Therefore we can iterate over jobs in order of ID and stop when we find a job that started more recently than max-age-seconds ago. Related to #18.
* lorry-controller-remove-old-jobs: Add start time to JobInfo classBen Hutchings2020-09-151-4/+7
| | | | | | | In order to filter jobs more efficiently, we need to look at the start time (job_started in the API) as well as the finish time. Related to #18.
* lorry-controller-remove-old-jobs: Use a single loop in process_argsBen Hutchings2020-09-151-10/+5
| | | | | | | In order to filter jobs earlier, we need to have a single loop over jobs in process_args(). Related to #18.
* lorry-controller-remove-old-jobs: Inline methods called by process_args()Ben Hutchings2020-09-151-21/+15
| | | | | | | | In order to filter jobs earlier, we need to have a single loop over jobs in process_args() instead of in multiple functions that it calls. Prepare for that by inlining the methods that it calls directly. Related to #18.
* Delete unused module importsBen Hutchings2020-08-101-1/+0
| | | | | | Various modules are imported and not used. Caught by pyflakes.
* Delete assignments to local variables that are not used laterBen Hutchings2020-08-101-1/+1
| | | | | | | pyflakes found various assignments to local variables which are not used again. In some cases we still need to evaluate the expression that's assigned. In most places we can delete the assignment entirely.
* Update to python3Pedro Alvarez2019-11-271-12/+10
|
* Remove trailing whitespaceBen Brown2015-12-151-1/+1
| | | | | | While we're here, seeing as Adam mentioned it. Change-Id: I5ddb86c70d76a84cf12fbd4eb91f3802e490d745
* Change the default job result expiry to 3 daysRichard Maw2015-10-141-2/+1
| | | | | | | | | | | | | | | From a disk space point of view, 1 year's worth of logs, while potentially excessive, isn't too much of an ask, since disk space is cheap enough. However our queries on the database run slower when it is large, so we need a shorter log retention policy, and it's best when the defaults do the right thing. 1 day's worth of logs was found to be 87MB, which means 3 days is roughly 250MB, which is acceptable. Change-Id: If3dd58fa01f785bc7d7029a45b6a0fc35c2c2b1d
* Add helper for removing old jobsLars Wirzenius2014-10-231-0/+153