Skip to content

Commit cb0a88d

Browse files
committed
[Command] enables parallel command execution by default
1 parent 298c043 commit cb0a88d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

doc/json_schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2107,9 +2107,9 @@
21072107
"default": false
21082108
},
21092109
"parallel": {
2110-
"description": "Set if the command should be executed in parallel with other commands\nMight improve performance when using multiple commands, but may cause issues with some commands",
2110+
"description": "Set if the command should be executed in parallel with other commands\nImprove performance when using multiple commands, but may cause issues with some commands",
21112111
"type": "boolean",
2112-
"default": false
2112+
"default": true
21132113
},
21142114
"key": {
21152115
"$ref": "#/$defs/key"

src/detection/command/command.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ const char* ffDetectCommand(FFCommandOptions* options, FFstrbuf* result)
4545
FFCommandResultBundle bundle = {};
4646
if (!options->parallel)
4747
bundle.error = spawnProcess(options, &bundle.handle);
48-
else
49-
ffListShift(&commandQueue, &bundle);
48+
else if (!ffListShift(&commandQueue, &bundle))
49+
return "[BUG] command queue is empty";
5050

5151
if (bundle.error)
5252
return bundle.error;

src/modules/command/command.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ void ffInitCommandOptions(FFCommandOptions* options)
131131
);
132132
ffStrbufInit(&options->text);
133133
options->useStdErr = false;
134-
options->parallel = false;
134+
options->parallel = true;
135135
}
136136

137137
void ffDestroyCommandOptions(FFCommandOptions* options)

0 commit comments

Comments
 (0)