/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 2005-2012 The OpenLDAP Foundation.
+ * Copyright 2005-2013 The OpenLDAP Foundation.
* Portions Copyright 2005-2006 SysNet s.n.c.
* All rights reserved.
*
di->di_suffix = be->be_suffix;
di->di_nsuffix = be->be_nsuffix;
- /* ... so that count, if required, is accurate */
- if ( di->di_max_dynamicObjects > 0 ) {
+ /* count the dynamic objects first */
+ rc = dds_count( thrctx, be );
+ if ( rc != LDAP_SUCCESS ) {
+ rc = 1;
+ goto done;
+ }
+
+ /* ... if there are dynamic objects, delete those expired */
+ if ( di->di_num_dynamicObjects > 0 ) {
/* force deletion of expired entries... */
be->bd_info = (BackendInfo *)on->on_info;
rc = dds_expire( thrctx, di );
rc = 1;
goto done;
}
-
- rc = dds_count( thrctx, be );
- if ( rc != LDAP_SUCCESS ) {
- rc = 1;
- goto done;
- }
}
/* start expire task */