You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Added watcher tests
* Added test reporting and test summary to ci
* Replaced Uber rate limiter with Golang rate limiter
* Added buffer fill support to windows and linux
Copy file name to clipboardExpand all lines: cmd/receiver/main.go
+1-11Lines changed: 1 addition & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,6 @@ import (
6
6
"oneway-filesync/pkg/database"
7
7
"oneway-filesync/pkg/receiver"
8
8
"oneway-filesync/pkg/utils"
9
-
"os"
10
-
"os/signal"
11
-
"syscall"
12
9
13
10
"github.com/sirupsen/logrus"
14
11
)
@@ -28,16 +25,9 @@ func main() {
28
25
return
29
26
}
30
27
31
-
iferr=database.ConfigureDatabase(db); err!=nil {
32
-
logrus.Errorf("Failed setting up db with err %v", err)
33
-
return
34
-
}
35
-
36
28
ctx, cancel:=context.WithCancel(context.Background()) // Create a cancelable context and pass it to all goroutines, allows us to gracefully shut down the program
Copy file name to clipboardExpand all lines: cmd/sender/main.go
+1-11Lines changed: 1 addition & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,6 @@ import (
6
6
"oneway-filesync/pkg/database"
7
7
"oneway-filesync/pkg/sender"
8
8
"oneway-filesync/pkg/utils"
9
-
"os"
10
-
"os/signal"
11
-
"syscall"
12
9
13
10
"github.com/sirupsen/logrus"
14
11
)
@@ -27,16 +24,9 @@ func main() {
27
24
return
28
25
}
29
26
30
-
iferr=database.ConfigureDatabase(db); err!=nil {
31
-
logrus.Errorf("Failed setting up db with err %v", err)
32
-
return
33
-
}
34
-
35
27
ctx, cancel:=context.WithCancel(context.Background()) // Create a cancelable context and pass it to all goroutines, allows us to gracefully shut down the program
Copy file name to clipboardExpand all lines: cmd/watcher/main.go
+6-17Lines changed: 6 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -2,42 +2,31 @@ package main
2
2
3
3
import (
4
4
"context"
5
+
"oneway-filesync/pkg/config"
5
6
"oneway-filesync/pkg/database"
6
7
"oneway-filesync/pkg/utils"
7
8
"oneway-filesync/pkg/watcher"
8
-
"os"
9
-
"os/signal"
10
-
"syscall"
11
9
12
-
"github.com/rjeczalik/notify"
13
10
"github.com/sirupsen/logrus"
14
11
)
15
12
16
13
funcmain() {
17
14
utils.InitializeLogging("watcher.log")
18
-
iflen(os.Args) <2 {
19
-
logrus.Errorf("Usage: %s <dir_path>", os.Args[0])
15
+
conf, err:=config.GetConfig("config.toml")
16
+
iferr!=nil {
17
+
logrus.Errorf("Failed reading config with err %v", err)
20
18
return
21
19
}
22
-
path:=os.Args[1]
23
20
24
21
db, err:=database.OpenDatabase("s_")
25
22
iferr!=nil {
26
23
logrus.Errorf("%v", err)
27
24
return
28
25
}
29
26
30
-
iferr=database.ConfigureDatabase(db); err!=nil {
31
-
logrus.Errorf("Failed setting up db with err %v", err)
32
-
return
33
-
}
34
-
35
-
events:=make(chan notify.EventInfo, 20)
36
27
ctx, cancel:=context.WithCancel(context.Background()) // Create a cancelable context and pass it to all goroutines, allows us to gracefully shut down the program
0 commit comments