mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-01 15:54:53 +00:00
Store the git hash of developer docs loaded
This will require some further updates on the loading side of things before it's fully valid, but for now track and show a link to the git hash used to build developer docs *if* one is specified. We only track it for devel (because releases have release numbers) and we only show it in the cases where we would already show the loading time.
This commit is contained in:
@ -104,6 +104,8 @@ parser.add_option("-q", "--quiet", action="store_true", dest="quiet",
|
||||
help="Run quietly (no output at all)")
|
||||
parser.add_option("-v", "--verbose", action="store_true", dest="verbose",
|
||||
help="Run verbosely")
|
||||
parser.add_option("-g", "--git", type=str,
|
||||
help="Specify git hash used to load")
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
if len(args) != 2:
|
||||
@ -233,7 +235,15 @@ if not quiet:
|
||||
|
||||
if numchanges > 0:
|
||||
# Update the docs loaded timestamp
|
||||
curs.execute("UPDATE core_version SET docsloaded=CURRENT_TIMESTAMP WHERE tree=%(v)s", {'v': ver})
|
||||
if ver == "0" and options.git:
|
||||
githash = options.git
|
||||
else:
|
||||
githash = ''
|
||||
|
||||
curs.execute("UPDATE core_version SET docsloaded=CURRENT_TIMESTAMP, docsgit=%(git)s WHERE tree=%(v)s", {
|
||||
'v': ver,
|
||||
'git': githash,
|
||||
})
|
||||
|
||||
# Issue varnish purge for all docs of this version
|
||||
if ver == "0":
|
||||
|
Reference in New Issue
Block a user