From c455e96e49bdb6f089d2a1c6d07b315e701f49fd Mon Sep 17 00:00:00 2001 From: Nikitin Aleksandr Date: Wed, 18 Sep 2024 14:45:28 +0300 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20StringFr?= =?UTF-8?q?omMassInt64()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- telegram_client/telegram_client.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/telegram_client/telegram_client.go b/telegram_client/telegram_client.go index 73313e00..75ffc80c 100644 --- a/telegram_client/telegram_client.go +++ b/telegram_client/telegram_client.go @@ -420,15 +420,20 @@ func CreateTelegramClient_err(func_OnNewMessage func(ctx context.Context, entiti LogDir := filepath.Join(sessionDir, "log") logFilePath := filepath.Join(LogDir, "log.jsonl") ok, err := micro.FileExists(LogDir) - if err != nil { - err = fmt.Errorf("FileExists() error: %w", err) - log.Error(err) - return err - } if ok == false { err = fmt.Errorf("FileExists() error: need create folder: %v", LogDir) log.Error(err) - //micro.CreateFolder(LogDir, 0666) + err := micro.CreateFolder(LogDir, 0600) //rw------- т.к. файл секретный + if err != nil { + log.Error("CreateFolder() error: ", err) + return err + } + //return err + } + + if err != nil { + err = fmt.Errorf("FileExists() error: %w", err) + log.Debug(err) return err }