@@ -66,16 +66,20 @@ cmd.handler = function(argv) {
66
66
if ( result . ok ) {
67
67
session . updateStat ( 'ac' , 1 ) ;
68
68
session . updateStat ( 'ac.set' , problem . fid ) ;
69
- if ( result . runtime_percentile )
70
- printLine ( result , 'Your runtime beats %d %% of %s submissions' ,
71
- result . runtime_percentile . toFixed ( 2 ) , result . lang ) ;
72
- else
73
- return log . warn ( 'Failed to get runtime percentile.' ) ;
74
- if ( result . memory && result . memory_percentile )
75
- printLine ( result , 'Your memory usage beats %d %% of %s submissions (%s)' ,
76
- result . memory_percentile . toFixed ( 2 ) , result . lang , result . memory ) ;
77
- else
78
- return log . warn ( 'Failed to get memory percentile.' ) ;
69
+
70
+ ( function ( ) {
71
+ if ( result . runtime_percentile )
72
+ printLine ( result , 'Your runtime beats %d %% of %s submissions' ,
73
+ result . runtime_percentile . toFixed ( 2 ) , result . lang ) ;
74
+ else
75
+ return log . warn ( 'Failed to get runtime percentile.' ) ;
76
+ if ( result . memory && result . memory_percentile )
77
+ printLine ( result , 'Your memory usage beats %d %% of %s submissions (%s)' ,
78
+ result . memory_percentile . toFixed ( 2 ) , result . lang , result . memory ) ;
79
+ else
80
+ return log . warn ( 'Failed to get memory percentile.' ) ;
81
+ } ) ( ) ;
82
+
79
83
// core.getSubmission({id: result.id}, function(e, submission) {
80
84
// if (e || !submission || !submission.distributionChart)
81
85
// return log.warn('Failed to get submission beat ratio.');
0 commit comments