Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-05-03 14:39:04 -0400
committerMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-05-03 14:39:04 -0400
commitad52dbec9a668567367ccab0a056eaf802648dd1 (patch)
tree280ee125f879e383b8dc7e24a64c24abe47ed5c9
parentb32d4e3d1b27d4ab010f0f4a64f90b96a74c7030 (diff)
downloadliza-ad52dbec9a668567367ccab0a056eaf802648dd1.tar.gz
liza-ad52dbec9a668567367ccab0a056eaf802648dd1.tar.bz2
liza-ad52dbec9a668567367ccab0a056eaf802648dd1.zip
controller: Only init submit notification if requestedv3.6.2
* src/server/daemon/controller.js (exports.init): Do not initialize submit notifier if no URL was provided.
-rw-r--r--src/server/daemon/controller.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/server/daemon/controller.js b/src/server/daemon/controller.js
index 6c51f75..17fda41 100644
--- a/src/server/daemon/controller.js
+++ b/src/server/daemon/controller.js
@@ -146,11 +146,16 @@ exports.init = function( logger, enc_service, conf )
''
);
- rating_service = RatingService
- .use( RatingServiceSubmitNotify( createSubmitDapi, dao ) )
- (
- logger, dao, server, exports.rater
- );
+ // only use the submit notification if a URL was provided
+ const RatingServiceBase = ( exports.no_results_url )
+ ? RatingService.use(
+ RatingServiceSubmitNotify( createSubmitDapi, dao )
+ )
+ : RatingService;
+
+ rating_service = RatingServiceBase(
+ logger, dao, server, exports.rater
+ );
// TODO: exports.init needs to support callbacks; this will work, but
// only because it's unlikely that we'll get a request within