mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-25 21:43:47 -04:00
Reduce some writes during HoC to help scaling
This commit is contained in:
parent
60f40bb859
commit
2588bfb08b
2 changed files with 3 additions and 1 deletions
app
|
@ -29,7 +29,8 @@ module.exports = class LevelBus extends Bus
|
|||
super(arguments...)
|
||||
@changedSessionProperties = {}
|
||||
if application.isProduction()
|
||||
@saveSession = _.debounce(@reallySaveSession, 4000, {maxWait: 10000}) # Save slower on production.
|
||||
#@saveSession = _.debounce(@reallySaveSession, 4000, {maxWait: 10000}) # Save slower on production.
|
||||
@saveSession = _.debounce(@reallySaveSession, 10000, {maxWait: 30000}) # Save even slower during HoC.
|
||||
else
|
||||
@saveSession = _.debounce(@reallySaveSession, 1000, {maxWait: 5000}) # Save quickly in development.
|
||||
@playerIsIdle = false
|
||||
|
|
|
@ -834,6 +834,7 @@ module.exports = class SpellView extends CocoView
|
|||
hashValue = aether.raw + aetherProblem.message
|
||||
return if hashValue of @savedProblems
|
||||
@savedProblems[hashValue] = true
|
||||
return unless Math.random() < 0.01 # Let's only save a tiny fraction of these during HoC to reduce writes.
|
||||
|
||||
# Save new problem
|
||||
@userCodeProblem = new UserCodeProblem()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue