Adding logging to icon server.

This commit is contained in:
Samuel Clay 2015-06-02 11:12:16 -07:00
parent 209eb08cf0
commit 65587ddc9c
2 changed files with 2 additions and 2 deletions

View file

@ -28,7 +28,7 @@ app.get /^\/rss_feeds\/icon\/(\d+)\/?/, (req, res) =>
feed_id = parseInt(req.params, 10)
etag = req.header('If-None-Match')
@collection.findOne _id: feed_id, (err, docs) ->
console.log "Req: #{feed_id}, etag: #{etag}/#{docs?.color}"
console.log "Req: #{feed_id}, etag: #{etag}/#{docs?.color} (err: #{err}, docs? #{!!(docs and docs.data)})"
if not err and etag and docs and docs?.color == etag
res.send 304
else if not err and docs and docs.data

View file

@ -50,7 +50,7 @@
return _this.collection.findOne({
_id: feed_id
}, function(err, docs) {
console.log("Req: " + feed_id + ", etag: " + etag + "/" + (docs != null ? docs.color : void 0));
console.log("Req: " + feed_id + ", etag: " + etag + "/" + (docs != null ? docs.color : void 0) + " (err: " + err + ", docs? " + (!!(docs && docs.data)) + ")");
if (!err && etag && docs && (docs != null ? docs.color : void 0) === etag) {
return res.send(304);
} else if (!err && docs && docs.data) {