ITS#8472 only do index cleanup if DB is running

This commit is contained in:
Howard Chu 2019-01-25 18:11:58 +00:00
parent e33d1c5461
commit 7b587018ec

View File

@ -281,6 +281,7 @@ mdb_cf_cleanup( ConfigArgs *c )
}
if ( mdb->mi_flags & MDB_OPEN_INDEX ) {
mdb->mi_flags ^= MDB_OPEN_INDEX;
rc = mdb_attr_dbs_open( c->be, NULL, &c->reply );
if ( rc )
rc = LDAP_OTHER;
@ -712,8 +713,8 @@ mdb_cf_gen( ConfigArgs *c )
c->argc - 1, &c->argv[1], &c->reply);
if( rc != LDAP_SUCCESS ) return 1;
mdb->mi_flags |= MDB_OPEN_INDEX;
if ( mdb->mi_flags & MDB_IS_OPEN ) {
mdb->mi_flags |= MDB_OPEN_INDEX;
c->cleanup = mdb_cf_cleanup;
if ( !mdb->mi_index_task ) {
/* Start the task as soon as we finish here. Set a long