mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-14 14:04:38 -04:00
Reducing some writes to try to help us scale up.
This commit is contained in:
parent
79a846e482
commit
cb54e08b9b
2 changed files with 7 additions and 2 deletions
app
|
@ -29,7 +29,8 @@ module.exports = class LevelBus extends Bus
|
|||
constructor: ->
|
||||
super(arguments...)
|
||||
@changedSessionProperties = {}
|
||||
@saveSession = _.debounce(@reallySaveSession, 1000, {maxWait: 5000})
|
||||
#@saveSession = _.debounce(@reallySaveSession, 1000, {maxWait: 5000}) # not during HoC apparently
|
||||
@saveSession = _.debounce(@reallySaveSession, 10000, {maxWait: 30000})
|
||||
@playerIsIdle = false
|
||||
|
||||
init: ->
|
||||
|
|
|
@ -308,7 +308,7 @@ module.exports = class SpellView extends CocoView
|
|||
|
||||
# Create locked default code text ranges
|
||||
@readOnlyRanges = []
|
||||
if @spell.language in ['python', 'coffeescript']
|
||||
if @spell.language in ['python', 'coffeescript']
|
||||
# Lock contiguous section of default code
|
||||
# Only works for languages without closing delimeters on blocks currently
|
||||
lines = @aceDoc.getAllLines()
|
||||
|
@ -730,6 +730,10 @@ module.exports = class SpellView extends CocoView
|
|||
hashValue = aether.raw + aetherProblem.message
|
||||
return if hashValue of @savedProblems
|
||||
@savedProblems[hashValue] = true
|
||||
if Math.random() > 0.01
|
||||
# Let's only save a tiny fraction of these during HoC to reduce writes.
|
||||
return
|
||||
|
||||
# Save new problem
|
||||
@userCodeProblem = new UserCodeProblem()
|
||||
@userCodeProblem.set 'code', aether.raw
|
||||
|
|
Loading…
Add table
Reference in a new issue