@@ -8,7 +8,6 @@ To handle the case where the underlying `git` processes appear to hang, configur
8
8
import { simpleGit , GitPluginError , SimpleGit , SimpleGitProgressEvent } from ' simple-git' ;
9
9
10
10
const git: SimpleGit = simpleGit ({
11
- baseDir: ' /some/path' ,
12
11
timeout: {
13
12
block: 2000 ,
14
13
},
@@ -39,10 +38,9 @@ Configure this with the optional `stdOut` and `stdErr` properties of the `timeou
39
38
configuration:
40
39
41
40
``` typescript
42
- import { simpleGit , GitPluginError , SimpleGit , SimpleGitProgressEvent } from " simple-git" ;
41
+ import { simpleGit , SimpleGit } from " simple-git" ;
43
42
44
43
const git: SimpleGit = simpleGit ({
45
- baseDir: " /some/path" ,
46
44
progress({method , stage , progress }) {
47
45
console .log (` git.${method } ${stage } stage ${progress }% complete ` );
48
46
},
@@ -54,3 +52,27 @@ const git: SimpleGit = simpleGit({
54
52
});
55
53
56
54
```
55
+
56
+ ## Absolute or Block Timeouts
57
+
58
+ The timeout plugin will reset its timers whenever data is received meaning the plugin will
59
+ only kill processes that appear to be hanging and allow intentionally long-running processes
60
+ to continue uninterrupted.
61
+
62
+ To change this default behaviour so that the plugin kills all processes after the supplied
63
+ timeout, configure it so the plugin doesn't listen for data updates by supplying the optional
64
+ ` stdOut ` and ` stdErr ` properties of the ` timeout ` plugin configuration:
65
+
66
+ ``` typescript
67
+ import { simpleGit , SimpleGit } from " simple-git" ;
68
+
69
+ // create a simple-git instance that kills any process after 5s
70
+ // whether it's still receiving data or not:
71
+ const git: SimpleGit = simpleGit ({
72
+ timeout: {
73
+ block: 5000 ,
74
+ stdOut: false ,
75
+ stdErr: false
76
+ }
77
+ });
78
+ ```
0 commit comments