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...)
|
super(arguments...)
|
||||||
@changedSessionProperties = {}
|
@changedSessionProperties = {}
|
||||||
if application.isProduction()
|
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
|
else
|
||||||
@saveSession = _.debounce(@reallySaveSession, 1000, {maxWait: 5000}) # Save quickly in development.
|
@saveSession = _.debounce(@reallySaveSession, 1000, {maxWait: 5000}) # Save quickly in development.
|
||||||
@playerIsIdle = false
|
@playerIsIdle = false
|
||||||
|
|
|
@ -834,6 +834,7 @@ module.exports = class SpellView extends CocoView
|
||||||
hashValue = aether.raw + aetherProblem.message
|
hashValue = aether.raw + aetherProblem.message
|
||||||
return if hashValue of @savedProblems
|
return if hashValue of @savedProblems
|
||||||
@savedProblems[hashValue] = true
|
@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
|
# Save new problem
|
||||||
@userCodeProblem = new UserCodeProblem()
|
@userCodeProblem = new UserCodeProblem()
|
||||||
|
|
Reference in a new issue