File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -43,11 +43,16 @@ func main() {
43
43
log .Notice (fmt .Sprintf ("fsnotify watcher create failed : %v" , err ))
44
44
os .Exit (1 )
45
45
}
46
- if err := fswatch .Add (watchPath ); err != nil {
47
- log .Notice (fmt .Sprintf ("watch failed : %v" , err ))
48
- os .Exit (1 )
46
+
47
+ if utils .DisableReload () {
48
+ log .Notice ("reload disabled, no watches added" )
49
+ } else {
50
+ if err := fswatch .Add (watchPath ); err != nil {
51
+ log .Notice (fmt .Sprintf ("watch failed : %v" , err ))
52
+ os .Exit (1 )
53
+ }
54
+ log .Notice (fmt .Sprintf ("watch : %s" , watchPath ))
49
55
}
50
- log .Notice (fmt .Sprintf ("watch : %s" , watchPath ))
51
56
52
57
// flag used for termination handling
53
58
var terminated bool
Original file line number Diff line number Diff line change @@ -55,3 +55,10 @@ func LoadEnvFile() []string {
55
55
56
56
return env
57
57
}
58
+
59
+ func DisableReload () bool {
60
+ if str , ok := os .LookupEnv ("DISABLE_RELOAD" ); ok {
61
+ return strings .EqualFold (str , "true" )
62
+ }
63
+ return false
64
+ }
You can’t perform that action at this time.
0 commit comments