mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-22 01:11:41 +03:00
fix: add missing rollback for LDAP sync
This commit is contained in:
@@ -58,6 +58,9 @@ func (s *LdapService) createClient() (*ldap.Conn, error) {
|
|||||||
func (s *LdapService) SyncAll(ctx context.Context) error {
|
func (s *LdapService) SyncAll(ctx context.Context) error {
|
||||||
// Start a transaction
|
// Start a transaction
|
||||||
tx := s.db.Begin()
|
tx := s.db.Begin()
|
||||||
|
defer func() {
|
||||||
|
tx.Rollback()
|
||||||
|
}()
|
||||||
|
|
||||||
err := s.SyncUsers(ctx, tx)
|
err := s.SyncUsers(ctx, tx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user