1
0
mirror of https://github.com/ManyakRus/telegram_loki.git synced 2025-09-16 08:56:28 +02:00

сделал RunSQL1()

This commit is contained in:
Nikitin Aleksandr
2025-09-04 16:22:54 +03:00
parent 5b708d4ab8
commit 9bc861e6de
5 changed files with 24 additions and 13 deletions

View File

@@ -1 +1 @@
2025-08-19 07:35:11.094
2025-09-04 13:20:53.037

View File

@@ -1 +1 @@
00199
00200

View File

@@ -16,7 +16,7 @@ func TestDownloadJSON(t *testing.T) {
date2 := time.Now()
date1 := carbon.NewCarbon(date2).AddDays(-2).StdTime()
Otvet, err := DownloadLogs("sync-service", date1, date2)
Otvet, err := DownloadLogs_full("sync-service", date1, date2)
if err != nil {
t.Error("TestDownloadJSON() error: ", err)
}
@@ -26,12 +26,12 @@ func TestDownloadJSON(t *testing.T) {
//}
}
func TestAuthentication(t *testing.T) {
ConfigMain.LoadEnv()
config.FillSettings()
err := Authentication()
if err != nil {
t.Error("TestAuthentication() error: ", err)
}
}
//func TestAuthentication(t *testing.T) {
// ConfigMain.LoadEnv()
// config.FillSettings()
//
// err := Authentication()
// if err != nil {
// t.Error("TestAuthentication() error: ", err)
// }
//}

View File

@@ -11,6 +11,7 @@ import (
"github.com/ManyakRus/telegram_loki/internal/telegram"
"github.com/ManyakRus/telegram_loki/internal/types"
"github.com/jackc/pgx/v5"
"html"
"os"
"path"
"strings"
@@ -193,6 +194,16 @@ func RunSQL1(Filename string) string {
if err != nil {
Otvet = fmt.Sprintf("db.QueryRow() Filename: %s, error: %v", FilenameShort, err)
log.Error(Otvet)
//отправим в телеграм
TextError := html.EscapeString(err.Error())
Message1 := types.Message{}
Message1.Text = TextError
err = telegram.SendMessage(Message1)
if err != nil {
log.Error("telegram.SendMessage() error: ", err)
}
return Otvet
}

View File

@@ -1 +1 @@
51b584c 2025-08-19 10:30:06 +0300
5b708d4 2025-08-19 10:55:05 +0300