mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2025-12-27 11:44:09 -05:00
Add a processing timeout. Set to 200ms for now; we'll see how that goes
This commit is contained in:
5
app.js
5
app.js
@@ -102,9 +102,14 @@ function compile(req, res) {
|
||||
);
|
||||
var stdout = "";
|
||||
var stderr = "";
|
||||
var timeout = setTimeout(function() {
|
||||
child.kill();
|
||||
stderr += "\nKilled - processing time exceeded";
|
||||
}, props.get("gcc-explorer", "compileTimeoutMs", 100));
|
||||
child.stdout.on('data', function (data) { stdout += data; });
|
||||
child.stderr.on('data', function (data) { stderr += data; });
|
||||
child.on('exit', function (code) {
|
||||
clearTimeout(timeout);
|
||||
child_process.exec('cat "' + outputFilename + '" | c++filt', function(err, filt_stdout, filt_stderr) {
|
||||
var data = filt_stdout;
|
||||
if (err) {
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
port=10240
|
||||
compileTimeoutMs=200
|
||||
compilers=/usr/bin/g++-4.4:/usr/bin/g++-4.5:/usr/bin/g++-4.6:/usr/bin/arm-linux-gnueabi-g++-4.5
|
||||
|
||||
Reference in New Issue
Block a user