@@ -9,22 +9,22 @@ var session = require('../session');
99
1010const plugin = new Plugin ( 50 , 'cache' , '' , 'Plugin to provide local cache.' ) ;
1111
12- plugin . getProblems = function ( cb ) {
12+ plugin . getProblems = function ( needTranslation , cb ) {
1313 const problems = cache . get ( h . KEYS . problems ) ;
1414 if ( problems ) {
1515 log . debug ( 'cache hit: problems.json' ) ;
1616 return cb ( null , problems ) ;
1717 }
1818
19- plugin . next . getProblems ( function ( e , problems ) {
19+ plugin . next . getProblems ( needTranslation , function ( e , problems ) {
2020 if ( e ) return cb ( e ) ;
2121
2222 cache . set ( h . KEYS . problems , problems ) ;
2323 return cb ( null , problems ) ;
2424 } ) ;
2525} ;
2626
27- plugin . getProblem = function ( problem , cb ) {
27+ plugin . getProblem = function ( problem , needTranslation , cb ) {
2828 const k = h . KEYS . problem ( problem ) ;
2929 const _problem = cache . get ( k ) ;
3030 if ( _problem ) {
@@ -42,7 +42,7 @@ plugin.getProblem = function(problem, cb) {
4242 }
4343 }
4444
45- plugin . next . getProblem ( problem , function ( e , _problem ) {
45+ plugin . next . getProblem ( problem , needTranslation , function ( e , _problem ) {
4646 if ( e ) return cb ( e ) ;
4747
4848 plugin . saveProblem ( _problem ) ;
0 commit comments