diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-06-15 18:33:37 +0100 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-06-15 18:34:27 +0100 |
commit | c2c9d606fc4fd584e725809a034908caa79d120a (patch) | |
tree | 33a6ed0b416297c14b2e526a08799ac6304ea3a2 | |
parent | f9a2fe043c0fae9e611ae72415be386ac23c097e (diff) | |
download | morph-cache-server-c2c9d606fc4fd584e725809a034908caa79d120a.tar.gz |
Sort artifacts view by n_builds after n_different_builds
It gets a bit random otherwise. Also sort by artifact name
alphabetically as a last resort. This seems to happen anyway, but
it's good to be explicit.
-rw-r--r-- | morphcacheserver/artifact_database.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/morphcacheserver/artifact_database.py b/morphcacheserver/artifact_database.py index 21d28ef..f98f4a0 100644 --- a/morphcacheserver/artifact_database.py +++ b/morphcacheserver/artifact_database.py @@ -204,7 +204,8 @@ class ArtifactDatabase(object): # Return the artifacts with the highest number of mismatched builds # first, they are the most important. Sort order should be configurable, # really. - sql = n_builds_per_artifact_sql + ' ORDER BY n_different_builds DESC' + sql = (n_builds_per_artifact_sql + ' ORDER BY n_different_builds DESC, ' + 'n_builds DESC, builds.cache_name') sql += ' LIMIT %i OFFSET %i' % (page_size, start) cursor = self.query(sql) |