diff --git a/server/src/config.js b/server/src/config.js index 4e20b97f3e..ed5c7e4bf3 100644 --- a/server/src/config.js +++ b/server/src/config.js @@ -418,6 +418,14 @@ const conf = convict({ env: "WATCHDOG_DEV_MATCH_HOSTNAME", arg: "watchdog-dev-match-hostname", }, + // The logs only mode is to be removed in #4936. + logsOnly: { + doc: "This should be temporary. When true, Screenshots will only log Watchdog results.", + format: Boolean, + default: true, + env: "WATCHDOG_LOGS_ONLY", + arg: "watchdog-logs-only", + }, }, }); diff --git a/server/src/watchdog.js b/server/src/watchdog.js index a254dfa9f0..24a9bad60a 100644 --- a/server/src/watchdog.js +++ b/server/src/watchdog.js @@ -296,11 +296,26 @@ exports.handleResult = function(req) { function handleNegative(record) { mozlog.debug("watchdog-negative-match", {msg: `Watchdog submission ${record.id} is a negative match.`}); + + if (config.watchdog.logsOnly) { + return null; + } + return db.update("UPDATE watchdog_submissions SET positive_result = FALSE WHERE id = $1", [record.id]); } function handlePositive(record) { - mozlog.info("watchdog-positive-match", {msg: `Watchdog submission ${record.id} is a positive match.`}); + mozlog.info( + "watchdog-positive-match", { + msg: `Watchdog submission for shot ${record.shot_id} is a positive match.`, + watchdogId: record.request_id, + watchdogSubmissionId: record.id, + }); + + if (config.watchdog.logsOnly) { + return null; + } + return db.transaction(client => { return db.queryWithClient( client,