diff --git a/ldapSync/ldapSync.go b/ldapSync/ldapSync.go index c10a023..b358ed7 100644 --- a/ldapSync/ldapSync.go +++ b/ldapSync/ldapSync.go @@ -181,13 +181,13 @@ func syncLdapUsers(app *pocketbase.PocketBase, ldapClient *ldap.Conn) SyncResult var removedCount int // remove old users - // step1: get a timeStamp one day ago - timeStamp := time.Now().AddDate(0, 0, -1) + // step1: get a timeStamp ten minutes ago + timeStamp := time.Now().Add(time.Minute * -10) // step2: get all users that have not been synced since that timeStamp records, err := app.Dao().FindRecordsByFilter( ldapUsersTableName, - "updated < {:timeStamp}", "", 0, 0, + "updated < {:timeStamp} && REALM = 'LDAP'", "", 0, 0, dbx.Params{"timeStamp": timeStamp}, )