mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-07-28 05:28:30 +00:00
rename package to 'logstasher'
This commit is contained in:
parent
03e6e99cb9
commit
75cf4fbb46
2 changed files with 8 additions and 5 deletions
|
@ -20,7 +20,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
|
|
||||||
"./logstash"
|
"./logstasher"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SuccessCommand is a Reply Command to indicate success in reply to a C2S Command.
|
// SuccessCommand is a Reply Command to indicate success in reply to a C2S Command.
|
||||||
|
@ -96,6 +96,8 @@ func SetupServerAndHandle(config *ConfigFile, serveMux *http.ServeMux) {
|
||||||
resp.Body.Close()
|
resp.Body.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logstasher.Setup(Configuration.ESServer, Configuration.ESIndexPrefix, Configuration.ESHostName)
|
||||||
|
|
||||||
go authorizationJanitor()
|
go authorizationJanitor()
|
||||||
go bunchCacheJanitor()
|
go bunchCacheJanitor()
|
||||||
go pubsubJanitor()
|
go pubsubJanitor()
|
||||||
|
@ -253,7 +255,7 @@ func RunSocketConnection(conn *websocket.Conn) {
|
||||||
// Close the connection when we're done.
|
// Close the connection when we're done.
|
||||||
defer closer()
|
defer closer()
|
||||||
|
|
||||||
var report logstash.ConnectionReport
|
var report logstasher.ConnectionReport
|
||||||
report.ConnectTime = time.Now()
|
report.ConnectTime = time.Now()
|
||||||
report.RemoteAddr = conn.RemoteAddr()
|
report.RemoteAddr = conn.RemoteAddr()
|
||||||
|
|
||||||
|
@ -306,7 +308,7 @@ func RunSocketConnection(conn *websocket.Conn) {
|
||||||
atomic.AddUint64(&Statistics.CurrentClientCount, NegativeOne)
|
atomic.AddUint64(&Statistics.CurrentClientCount, NegativeOne)
|
||||||
}
|
}
|
||||||
|
|
||||||
logstash.Submit(report)
|
logstasher.Submit(&report)
|
||||||
}
|
}
|
||||||
|
|
||||||
func runSocketReader(conn *websocket.Conn, errorChan chan<- error, clientChan chan<- ClientMessage, stoppedChan <-chan struct{}) {
|
func runSocketReader(conn *websocket.Conn, errorChan chan<- error, clientChan chan<- ClientMessage, stoppedChan <-chan struct{}) {
|
||||||
|
@ -407,7 +409,7 @@ func getDeadline() time.Time {
|
||||||
return time.Now().Add(1 * time.Minute)
|
return time.Now().Add(1 * time.Minute)
|
||||||
}
|
}
|
||||||
|
|
||||||
func closeConnection(conn *websocket.Conn, closeMsg websocket.CloseError, report *esConnectionReport) {
|
func closeConnection(conn *websocket.Conn, closeMsg websocket.CloseError, report *logstasher.ConnectionReport) {
|
||||||
closeTxt := closeMsg.Text
|
closeTxt := closeMsg.Text
|
||||||
if strings.Contains(closeTxt, "read: connection reset by peer") {
|
if strings.Contains(closeTxt, "read: connection reset by peer") {
|
||||||
closeTxt = "read: connection reset by peer"
|
closeTxt = "read: connection reset by peer"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package server
|
package logstasher
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
@ -146,6 +146,7 @@ func checkServerPresent() {
|
||||||
resp.Body.Close()
|
resp.Body.Close()
|
||||||
serverPresent = true
|
serverPresent = true
|
||||||
submitChan = make(chan Report, 8)
|
submitChan = make(chan Report, 8)
|
||||||
|
fmt.Println("elasticsearch reports enabled")
|
||||||
go submissionWorker()
|
go submissionWorker()
|
||||||
} else {
|
} else {
|
||||||
serverPresent = false
|
serverPresent = false
|
Loading…
Add table
Add a link
Reference in a new issue