--dynamic-timeout
- Accepted by
opengrep scan,opengrep ci- Default
false
--timeout gives every rule the same time on every file. With --dynamic-timeout, the limit grows with the size of the file:
limit = timeout × clamp(file size in KB / unit, 1, max multiplier)The unit is --dynamic-timeout-unit-kb, 30 by default, and the largest multiplier is --dynamic-timeout-max-multiplier, 20 by default. With the default timeout of 5 seconds, a file under 30 KB gets 5 seconds, a file of 150 KB 25 seconds, and a file of 600 KB or more 100 seconds.
A --timeout of 0 sets no limit, and the flag has no effect.
A rule can request the same scaling with the option dynamic_timeout, which applies only when the scan also passes --allow-rule-timeout-control.
Examples
Giving large files more time
Command
$ opengrep scan -q --config rules/ --timeout 5 --dynamic-timeout .