1
0
Fork 0

controller: Only init submit notification if requested

* src/server/daemon/controller.js (exports.init): Do not initialize submit
    notifier if no URL was provided.
master
Mike Gerwitz 2018-05-03 14:39:04 -04:00
parent b32d4e3d1b
commit ad52dbec9a
1 changed files with 10 additions and 5 deletions

View File

@ -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