mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-27 06:23:41 -04:00
Merge branch 'master' into courses-vhoc
This commit is contained in:
commit
6d4c17f724
4 changed files with 7 additions and 2 deletions
|
@ -19,6 +19,7 @@ preventBackspace = (event) ->
|
|||
if event.keyCode is 8 and not elementAcceptsKeystrokes(event.srcElement or event.target)
|
||||
event.preventDefault()
|
||||
else if (key.ctrl or key.command) and not key.alt and event.keyCode in ctrlDefaultPrevented
|
||||
console.debug "Prevented keystroke", key
|
||||
event.preventDefault()
|
||||
|
||||
elementAcceptsKeystrokes = (el) ->
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
"uglify-js": "^2.5.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"newrelic": "^1.24.0",
|
||||
"webworker-threads": "~0.5.5"
|
||||
},
|
||||
"license": "MIT for the code, and CC-BY for the art and music",
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require 'newrelic' if process.env.NEW_RELIC_LICENSE_KEY?
|
||||
|
||||
do (setupLodash = this) ->
|
||||
GLOBAL._ = require 'lodash'
|
||||
_.str = require 'underscore.string'
|
||||
|
|
|
@ -25,7 +25,8 @@ exports.middleware = (req, res, next) ->
|
|||
path = req.route?.path or '/*'
|
||||
stat = req.method + "." + path.replace /[^A-Za-z0-9]+/g, '_'
|
||||
realClient.timing stat, ms
|
||||
|
||||
name = req.user?._id
|
||||
realClient.unique 'users', name if name
|
||||
|
||||
res.once 'finish', recordMetrics
|
||||
res.once 'error', cleanup
|
||||
|
@ -39,5 +40,5 @@ exports.trace = (name, callback) ->
|
|||
return callback unless realClient
|
||||
time = process.hrtime()
|
||||
(args...) ->
|
||||
realClient.timing name, ms
|
||||
realClient.timing name.replace(/[^A-Za-z0-9]+/g, '_'), ms
|
||||
return callback.apply(this, args)
|
Loading…
Add table
Add a link
Reference in a new issue