Skip to content

Commit 9abf120

Browse files
committed
add delay for fsnotify
1 parent 8e43a15 commit 9abf120

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

conf/config-sample.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ log:
55
convert:
66
source: "/etc/openclash/rule_provider"
77
target: "/etc/mosdns/from_provider"
8-
processFiles:
8+
processFiles:
99
- "ai.txt"
1010
- "apple.yaml"
1111
- "direct.yaml"
@@ -16,4 +16,5 @@ convert:
1616
# run background to watch the file change
1717
service:
1818
enable: True
19-
dbFile: "/etc/mosdns/provider2domainset.db"
19+
delay: 60
20+
dbFile: "/etc/mosdns/provider2domainset.db"

conf/config.go

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ var Convert struct {
2020

2121
var Service struct {
2222
Enable bool
23+
Delay int
2324
DbFile string
2425
}
2526

@@ -57,6 +58,7 @@ func update() {
5758
Convert.ProcessFiles = viper.GetStringSlice("convert.process_files")
5859

5960
Service.Enable = viper.GetBool("service.enable")
61+
Service.Delay = viper.GetInt("service.delay")
6062
Service.DbFile = viper.GetString("service.db_file")
6163

6264
if level, err := zapcore.ParseLevel(viper.GetString("log.level")); err == nil {

0 commit comments

Comments
 (0)