File tree Expand file tree Collapse file tree 5 files changed +18
-8
lines changed Expand file tree Collapse file tree 5 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66
77## [ Unreleased]
88
9+ ## [ 2.0.4]
10+ ### Fixed
11+ - Load limits from /common/config
12+
913## [ 2.0.3]
1014### Fixed
1115- Handle unhandled promise rejections
@@ -26,4 +30,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2630- Tracers for Java and C++.
2731
2832### Changed
29- - Almost every method has been changed. Take a look at [ Tracer API] ( https://github.com/algorithm-visualizer/tracers/wiki ) .
33+ - Almost every method has been changed. Take a look at [ Tracer API] ( https://github.com/algorithm-visualizer/tracers/wiki ) .
Original file line number Diff line number Diff line change 11{
22 "name" : " @algorithm-visualizer/tracer-generator" ,
3- "version" : " 2.0.3 " ,
3+ "version" : " 2.0.4 " ,
44 "description" : " Visualization Libraries for Algorithm Visualizer" ,
55 "scripts" : {
66 "build" : " node ./node_modules/webpack/bin/webpack --bail --progress --config webpack.config.js && chmod +x ./bin/*"
Original file line number Diff line number Diff line change 1- export { } ;
1+ const maxTraces = 1e6 ;
2+ const maxTracers = 1e2 ;
3+
4+ export {
5+ maxTraces ,
6+ maxTracers ,
7+ } ;
Original file line number Diff line number Diff line change 11import { execute } from '/common/util' ;
22import Commander from '/languages/Commander' ;
3+ import { maxTracers , maxTraces } from '/common/config' ;
34
45class Executer extends Commander {
56 constructor ( { name, compileCommand, runCommand } ) {
@@ -17,7 +18,7 @@ class Executer extends Commander {
1718 '-w=/usr/judge' ,
1819 `-v=$PWD/tracers:/usr/bin/tracers:ro` ,
1920 `-v=${ tempPath } :/usr/judge:rw` ,
20- `-e MAX_TRACES=${ 1e6 } -e MAX_TRACERS=${ 1e2 } ` , // TODO: load from /common/config
21+ `-e MAX_TRACES=${ maxTraces } -e MAX_TRACERS=${ maxTracers } ` ,
2122 this . executerImageTag ,
2223 '/bin/bash -c' ,
2324 `"${ command } "` ,
Original file line number Diff line number Diff line change 1- const MAX_TRACES = 1e6 ;
2- const MAX_TRACERS = 1e2 ;
1+ import { maxTraces , maxTracers } from '../../../../common/config' ;
32
43class Tracer {
54 static addTracer ( className , title ) {
@@ -17,8 +16,8 @@ class Tracer {
1716 args : JSON . parse ( JSON . stringify ( args ) ) ,
1817 } ;
1918 this . traces . push ( trace ) ;
20- if ( this . traces . length > MAX_TRACES ) throw new Error ( 'Traces Limit Exceeded' ) ;
21- if ( this . tracerCount > MAX_TRACERS ) throw new Error ( 'Tracers Limit Exceeded' ) ;
19+ if ( this . traces . length > maxTraces ) throw new Error ( 'Traces Limit Exceeded' ) ;
20+ if ( this . tracerCount > maxTracers ) throw new Error ( 'Tracers Limit Exceeded' ) ;
2221 }
2322
2423 constructor ( title = this . constructor . name ) {
You can’t perform that action at this time.
0 commit comments