This commit is contained in:
@@ -67,7 +67,7 @@ var DaemonCmd = &cobra.Command{
|
|||||||
j.LoadRules(r)
|
j.LoadRules(r)
|
||||||
go j.UnbanChecker()
|
go j.UnbanChecker()
|
||||||
go j.Tribunal()
|
go j.Tribunal()
|
||||||
go storage.Write(reqDb_w, resultCh)
|
go storage.WriteReq(reqDb_w, resultCh)
|
||||||
var scanners []*parser.Scanner
|
var scanners []*parser.Scanner
|
||||||
|
|
||||||
for _, svc := range cfg.Service {
|
for _, svc := range cfg.Service {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Write(db *Request_Writer, resultCh <-chan *LogEntry) {
|
func WriteReq(db *Request_Writer, resultCh <-chan *LogEntry) {
|
||||||
db.logger.Info("Starting log writer")
|
db.logger.Info("Starting log writer")
|
||||||
const batchSize = 100
|
const batchSize = 100
|
||||||
const flushInterval = 1 * time.Second
|
const flushInterval = 1 * time.Second
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ func TestWrite_BatchInsert(t *testing.T) {
|
|||||||
|
|
||||||
done := make(chan bool)
|
done := make(chan bool)
|
||||||
go func() {
|
go func() {
|
||||||
Write(writer, resultCh)
|
WriteReq(writer, resultCh)
|
||||||
close(done)
|
close(done)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@ func TestWrite_BatchSizeTrigger(t *testing.T) {
|
|||||||
resultCh := make(chan *LogEntry, 100)
|
resultCh := make(chan *LogEntry, 100)
|
||||||
done := make(chan bool)
|
done := make(chan bool)
|
||||||
go func() {
|
go func() {
|
||||||
Write(writer, resultCh)
|
WriteReq(writer, resultCh)
|
||||||
close(done)
|
close(done)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
@@ -167,7 +167,7 @@ func TestWrite_FlushInterval(t *testing.T) {
|
|||||||
|
|
||||||
done := make(chan bool)
|
done := make(chan bool)
|
||||||
go func() {
|
go func() {
|
||||||
Write(writer, resultCh)
|
WriteReq(writer, resultCh)
|
||||||
close(done)
|
close(done)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
@@ -216,7 +216,7 @@ func TestWrite_EmptyBatch(t *testing.T) {
|
|||||||
|
|
||||||
done := make(chan bool)
|
done := make(chan bool)
|
||||||
go func() {
|
go func() {
|
||||||
Write(writer, resultCh)
|
WriteReq(writer, resultCh)
|
||||||
close(done)
|
close(done)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
@@ -250,7 +250,7 @@ func TestWrite_ChannelClosed(t *testing.T) {
|
|||||||
|
|
||||||
done := make(chan bool)
|
done := make(chan bool)
|
||||||
go func() {
|
go func() {
|
||||||
Write(writer, resultCh)
|
WriteReq(writer, resultCh)
|
||||||
close(done)
|
close(done)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user