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.
6
6
7
7
## [ Unreleased]
8
8
9
+ ## [ 2.0.4]
10
+ ### Fixed
11
+ - Load limits from /common/config
12
+
9
13
## [ 2.0.3]
10
14
### Fixed
11
15
- Handle unhandled promise rejections
@@ -26,4 +30,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
26
30
- Tracers for Java and C++.
27
31
28
32
### 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 1
1
{
2
2
"name" : " @algorithm-visualizer/tracer-generator" ,
3
- "version" : " 2.0.3 " ,
3
+ "version" : " 2.0.4 " ,
4
4
"description" : " Visualization Libraries for Algorithm Visualizer" ,
5
5
"scripts" : {
6
6
"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 1
1
import { execute } from '/common/util' ;
2
2
import Commander from '/languages/Commander' ;
3
+ import { maxTracers , maxTraces } from '/common/config' ;
3
4
4
5
class Executer extends Commander {
5
6
constructor ( { name, compileCommand, runCommand } ) {
@@ -17,7 +18,7 @@ class Executer extends Commander {
17
18
'-w=/usr/judge' ,
18
19
`-v=$PWD/tracers:/usr/bin/tracers:ro` ,
19
20
`-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 } ` ,
21
22
this . executerImageTag ,
22
23
'/bin/bash -c' ,
23
24
`"${ 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' ;
3
2
4
3
class Tracer {
5
4
static addTracer ( className , title ) {
@@ -17,8 +16,8 @@ class Tracer {
17
16
args : JSON . parse ( JSON . stringify ( args ) ) ,
18
17
} ;
19
18
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' ) ;
22
21
}
23
22
24
23
constructor ( title = this . constructor . name ) {
You can’t perform that action at this time.
0 commit comments