extended logging
This commit is contained in:
@@ -147,6 +147,20 @@ func (m *memoryTokenRepository) Update(_ context.Context, obj storable.Storable)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *memoryTokenRepository) Upsert(ctx context.Context, obj storable.Storable) error {
|
||||
id := obj.GetID()
|
||||
if id == nil || *id == bson.NilObjectID {
|
||||
return m.Insert(ctx, obj, nil)
|
||||
}
|
||||
if err := m.Update(ctx, obj); err != nil {
|
||||
if errors.Is(err, merrors.ErrNoData) {
|
||||
return m.Insert(ctx, obj, nil)
|
||||
}
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *memoryTokenRepository) PatchMany(_ context.Context, filter builder.Query, patch builder.Patch) (int, error) {
|
||||
m.mu.Lock()
|
||||
defer m.mu.Unlock()
|
||||
|
||||
Reference in New Issue
Block a user