mirror of
https://github.com/mxpv/podsync.git
synced 2024-05-11 05:55:04 +00:00
Use cache for error feeds to reduce spamming
This commit is contained in:
@ -69,7 +69,7 @@ func (l *Lambda) Build(feed *model.Feed) error {
|
||||
}
|
||||
|
||||
if out.ErrorMessage != "" {
|
||||
return errors.Errorf("lambda error: %s", out.ErrorMessage)
|
||||
return errors.New(out.ErrorMessage)
|
||||
}
|
||||
|
||||
feed.LastID = out.LastID
|
||||
|
@ -175,6 +175,10 @@ func (s *Service) BuildFeed(hashID string) ([]byte, error) {
|
||||
|
||||
if err := builder.Build(feed); err != nil {
|
||||
logger.WithError(err).Error("failed to build feed")
|
||||
|
||||
// Save error to cache to avoid spamming
|
||||
_ = s.cache.Set(hashID, err.Error(), 10 * time.Minute)
|
||||
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user