Skip to content

Commit 8200a2e

Browse files
Mark the callback as optional
Without callback, it is impossible to unit-test the backbeat routes, as we run async code and do not yet support promises. Issue: CLDSRV-591
1 parent a0f2c3f commit 8200a2e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/routes/routeBackbeat.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,8 @@ const indexingSchema = joi.array().items(indexEntrySchema).min(1);
13101310

13111311
function respondToRequest(err, response, log, callback) {
13121312
responseJSONBody(err, null, response, log);
1313-
return callback(err);
1313+
// The callback is optional, as it is only used for testing purposes
1314+
return callback?.(err);
13141315
}
13151316

13161317
function routeIndexingAPIs(request, response, userInfo, log, callback) {

0 commit comments

Comments
 (0)