rename GetJournalctlLogs -> GetJournalctlLogsCount
parent
b81ce295c6
commit
341beefd9b
|
@ -17,7 +17,7 @@ func MainPageHandler(a *models.App) http.HandlerFunc {
|
||||||
// Количество запросов, обработанных сервером за 24ч
|
// Количество запросов, обработанных сервером за 24ч
|
||||||
if r.Method == "COUNT" {
|
if r.Method == "COUNT" {
|
||||||
var count []byte
|
var count []byte
|
||||||
if count, err = tools.GetJournalctlLogs("server", a.Config.ServerDomain, 24); err != nil {
|
if count, err = tools.GetJournalctlLogsCount("server", a.Config.ServerDomain, 24); err != nil {
|
||||||
log.Printf("%s", err.Error())
|
log.Printf("%s", err.Error())
|
||||||
}
|
}
|
||||||
SendCount(w, count)
|
SendCount(w, count)
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"runtime"
|
"runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetJournalctlLogs(serviceName, grepPattern string, hoursAgo int) ([]byte, error) {
|
func GetJournalctlLogsCount(serviceName, grepPattern string, hoursAgo int) ([]byte, error) {
|
||||||
|
|
||||||
if runtime.GOOS != "linux" {
|
if runtime.GOOS != "linux" {
|
||||||
return nil, fmt.Errorf("not a linux")
|
return nil, fmt.Errorf("not a linux")
|
||||||
|
|
Loading…
Reference in New Issue