mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-22 11:09:02 -05:00
avoid panicing in userlog service
Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
@@ -166,7 +166,7 @@ func (ul *UserlogService) MemorizeEvents(ch <-chan events.Event) {
|
||||
func (ul *UserlogService) GetEvents(ctx context.Context, userid string) ([]*ehmsg.Event, error) {
|
||||
rec, err := ul.store.Read(userid)
|
||||
if err != nil && err != store.ErrNotFound {
|
||||
ul.log.Fatal().Err(err).Str("userid", userid).Msg("failed to read record from database")
|
||||
ul.log.Error().Err(err).Str("userid", userid).Msg("failed to read record from database")
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ func (ul *UserlogService) GetEvents(ctx context.Context, userid string) ([]*ehms
|
||||
|
||||
var eventIDs []string
|
||||
if err := json.Unmarshal(rec[0].Value, &eventIDs); err != nil {
|
||||
ul.log.Fatal().Err(err).Str("userid", userid).Msg("failed to umarshal record from database")
|
||||
ul.log.Error().Err(err).Str("userid", userid).Msg("failed to umarshal record from database")
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user