Use docstore url rather than going through web api.

This commit is contained in:
Shane Kilkelly 2016-01-27 09:58:54 +00:00
parent a043f28d9b
commit fed10280ab
2 changed files with 4 additions and 4 deletions

View file

@ -12,7 +12,7 @@ fiveMinsInMs = oneMinInMs * 5
module.exports = ReferencesSearchHandler =
_buildDocUrl: (projectId, docId) ->
"#{settings.apis.web.url}/project/#{projectId}/doc/#{docId}"
"#{settings.apis.docstore.url}/project/#{projectId}/doc/#{docId}/raw"
_findBibDocIds: (project) ->
ids = []
@ -48,7 +48,7 @@ module.exports = ReferencesSearchHandler =
return callback(err)
bibDocUrls = docIds.map (docId) ->
ReferencesSearchHandler._buildDocUrl projectId, docId
logger.log {projectId, isFullIndex, docIds}, "sending request to references service"
logger.log {projectId, isFullIndex, docIds, bibDocUrls}, "sending request to references service"
request.post {
url: "#{settings.apis.references.url}/project/#{projectId}/index"
json:

View file

@ -32,8 +32,8 @@ describe 'ReferencesSearchHandler', ->
}
'settings-sharelatex': @settings = {
apis:
references: {url: 'http://some.url'}
web: {url: 'http://some.url'}
references: {url: 'http://some.url/references'}
docstore: {url: 'http://some.url/docstore'}
}
'request': @request = {
get: sinon.stub()