return from _doIndexOperation if referneces is not setup eailer

This commit is contained in:
Henry Oswald 2016-06-24 15:04:10 +01:00
parent cc9f90c3e8
commit 8d79b37651

View file

@ -66,6 +66,8 @@ module.exports = ReferencesHandler =
ReferencesHandler._doIndexOperation(projectId, project, docIds, [], callback) ReferencesHandler._doIndexOperation(projectId, project, docIds, [], callback)
_doIndexOperation: (projectId, project, docIds, fileIds, callback) -> _doIndexOperation: (projectId, project, docIds, fileIds, callback) ->
if !settings.apis?.references?.url?
return callback()
ReferencesHandler._isFullIndex project, (err, isFullIndex) -> ReferencesHandler._isFullIndex project, (err, isFullIndex) ->
if err if err
logger.err {err, projectId}, "error checking whether to do full index" logger.err {err, projectId}, "error checking whether to do full index"
@ -84,8 +86,6 @@ module.exports = ReferencesHandler =
ReferencesHandler._buildFileUrl projectId, fileId ReferencesHandler._buildFileUrl projectId, fileId
allUrls = bibDocUrls.concat(bibFileUrls) allUrls = bibDocUrls.concat(bibFileUrls)
logger.log {projectId, isFullIndex, docIds, bibDocUrls}, "sending request to references service" logger.log {projectId, isFullIndex, docIds, bibDocUrls}, "sending request to references service"
if !settings.apis.references.url?
return callback()
request.post { request.post {
url: "#{settings.apis.references.url}/project/#{projectId}/index" url: "#{settings.apis.references.url}/project/#{projectId}/index"
json: json: