Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Fix #4569; Return both DB and JS patch levels in __version__
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhirsch committed Jul 4, 2018
1 parent cb96507 commit 4b046a8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
1 change: 1 addition & 0 deletions server/src/dbschema.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ function getCurrentDbPatchLevel() {
return 0;
});
}
exports.getCurrentDbPatchLevel = getCurrentDbPatchLevel;

exports.connectionOK = function() {
if (!keys) {
Expand Down
31 changes: 18 additions & 13 deletions server/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -959,19 +959,24 @@ app.get("/images/:imageid", function(req, res) {
});

app.get("/__version__", function(req, res) {
const response = {
source: "https://github.com/mozilla-services/screenshots/",
description: "Firefox Screenshots application server",
version: selfPackage.version,
buildDate: buildTime,
commit: linker.getGitRevision(),
contentOrigin: config.contentOrigin,
commitLog: `https://github.com/mozilla-services/screenshots/commits/${linker.getGitRevision()}`,
unincludedCommits: `https://github.com/mozilla-services/screenshots/compare/${linker.getGitRevision()}...master`,
dbSchemaVersion: dbschema.MAX_DB_LEVEL
};
res.header("Content-Type", "application/json; charset=utf-8");
res.send(JSON.stringify(response, null, " "));
dbschema.getCurrentDbPatchLevel().then(level => {
const response = {
source: "https://github.com/mozilla-services/screenshots/",
description: "Firefox Screenshots application server",
version: selfPackage.version,
buildDate: buildTime,
commit: linker.getGitRevision(),
contentOrigin: config.contentOrigin,
commitLog: `https://github.com/mozilla-services/screenshots/commits/${linker.getGitRevision()}`,
unincludedCommits: `https://github.com/mozilla-services/screenshots/compare/${linker.getGitRevision()}...master`,
dbSchemaVersion: level,
dbSchemaVersionJS: dbschema.MAX_DB_LEVEL
};
res.header("Content-Type", "application/json; charset=utf-8");
res.send(JSON.stringify(response, null, " "));
}).catch((e) => {
errorResponse(res, "Error fetching version data: ", e);
});
});

app.get("/contribute.json", function(req, res) {
Expand Down

0 comments on commit 4b046a8

Please sign in to comment.