Skip to content

Commit

Permalink
fix: always log error when automatic LDAP sync fails
Browse files Browse the repository at this point in the history
  • Loading branch information
stropitek committed Sep 26, 2017
1 parent 45af857 commit 4ada695
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/couch/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,18 @@ const methods = {
};

async function startLDAPSync(db) {
await tryLDAPSync(db);
setInterval(async () => {
await tryLDAPSync(db);
}, 1000 * db._couchOptions.ldapGroupsRenewal);
}

async function tryLDAPSync(db) {
try {
await db.syncLDAPGroups();
} catch (e) {
debug('LDAP sync failed initialization', e);
debug.error('LDAP sync failed initialization', e);
}
setInterval(() => db.syncLDAPGroups(), 1000 * db._couchOptions.ldapGroupsRenewal);
}

async function checkSecurity(db, admin) {
Expand Down

0 comments on commit 4ada695

Please sign in to comment.