added some debugging

This commit is contained in:
Henry Oswald 2018-07-30 15:18:25 +01:00
parent f2dfb718c6
commit daf40fc757

View file

@ -94,11 +94,13 @@ module.exports = UrlCache =
return callback() return callback()
_findUrlDetails: (project_id, url, callback = (error, urlDetails) ->) -> _findUrlDetails: (project_id, url, callback = (error, urlDetails) ->) ->
console.log("_findUrlDetails")
db.UrlCache.find(where: { url: url, project_id: project_id }) db.UrlCache.find(where: { url: url, project_id: project_id })
.then((urlDetails) -> callback null, urlDetails) .then((urlDetails) -> callback null, urlDetails)
.error callback .error callback
_updateOrCreateUrlDetails: (project_id, url, lastModified, callback = (error) ->) -> _updateOrCreateUrlDetails: (project_id, url, lastModified, callback = (error) ->) ->
console.log("_updateOrCreateUrlDetails")
db.UrlCache.findOrCreate(where: {url: url, project_id: project_id}) db.UrlCache.findOrCreate(where: {url: url, project_id: project_id})
.spread( .spread(
(urlDetails, created) -> (urlDetails, created) ->
@ -109,11 +111,13 @@ module.exports = UrlCache =
.error callback .error callback
_clearUrlDetails: (project_id, url, callback = (error) ->) -> _clearUrlDetails: (project_id, url, callback = (error) ->) ->
console.log("_clearUrlDetails")
db.UrlCache.destroy(where: {url: url, project_id: project_id}) db.UrlCache.destroy(where: {url: url, project_id: project_id})
.then(() -> callback null) .then(() -> callback null)
.error callback .error callback
_findAllUrlsInProject: (project_id, callback = (error, urls) ->) -> _findAllUrlsInProject: (project_id, callback = (error, urls) ->) ->
console.log("_findAllUrlsInProject")
db.UrlCache.findAll(where: { project_id: project_id }) db.UrlCache.findAll(where: { project_id: project_id })
.then( .then(
(urlEntries) -> (urlEntries) ->