Поправил панику при ошибке

This commit is contained in:
Alexander NeonXP Kiryukhin 2024-07-13 22:01:10 +03:00
parent a4e4a6d0bf
commit ac79d42057
Signed by: NeonXP
GPG key ID: 35E33E1AB7776B39
2 changed files with 4 additions and 1 deletions

View file

@ -3,6 +3,7 @@ package app
import ( import (
"bytes" "bytes"
"context" "context"
"log/slog"
"os" "os"
"text/template" "text/template"
"time" "time"
@ -44,7 +45,7 @@ func (a *App) Run(ctx context.Context) error {
return nil return nil
case <-ticker.C: case <-ticker.C:
if err := a.iteration(); err != nil { if err := a.iteration(); err != nil {
return err slog.ErrorContext(ctx, "failed iteration", slog.Any("error", err))
} }
} }
} }

View file

@ -2,4 +2,6 @@
<b>Новый пост в блоге Уголок NeonXP:</b> <b>Новый пост в блоге Уголок NeonXP:</b>
<a href="{{.Link}}">{{.Title}}</a> <a href="{{.Link}}">{{.Title}}</a>
Отправлено через <a href="https://gitrepo.ru/neonxp/rss2world">rss2world</a>
{{end}} {{end}}