Fix panic in /preview/channel/{id}
All checks were successful
Build Docker and Deploy / Build Docker Container (push) Successful in 1m49s
Build Docker and Deploy / Run Unit-Tests (push) Successful in 7m56s
Build Docker and Deploy / Deploy to Server (push) Successful in 39s

This commit is contained in:
2026-03-27 12:57:19 +01:00
parent 1f9abb8574
commit e98a804efc
9 changed files with 34 additions and 31 deletions

View File

@@ -1,14 +1,15 @@
package jobs
import (
"errors"
"fmt"
"time"
"blackforestbytes.com/simplecloudnotifier/db/simplectx"
"blackforestbytes.com/simplecloudnotifier/logic"
"blackforestbytes.com/simplecloudnotifier/models"
"errors"
"fmt"
"git.blackforestbytes.com/BlackForestBytes/goext/syncext"
"github.com/rs/zerolog/log"
"time"
)
type DeliveryRetryJob struct {
@@ -208,7 +209,7 @@ func (j *DeliveryRetryJob) redeliver(ctx *simplectx.SimpleContext, delivery mode
return
}
channel, err := j.app.Database.Primary.GetChannelByID(ctx, msg.ChannelID)
channel, err := j.app.Database.Primary.GetChannelByIDOpt(ctx, msg.ChannelID)
if err != nil {
log.Err(err).Str("ChannelID", msg.ChannelID.String()).Msg("Failed to get channel")
ctx.RollbackTransaction()