0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 17:10:48 +01:00

Merge branch 'master' of github.com:mongodb/mongo

This commit is contained in:
Aaron 2010-05-13 11:09:34 -07:00
commit d7e538ba9f

View File

@ -56,34 +56,35 @@ namespace mongo {
} }
void Client::dropTempCollectionsInDB( const string db ) { void Client::dropTempCollectionsInDB( const string db ) {
list<string>::iterator i = _tempCollections.begin(); list<string>::iterator i = _tempCollections.begin();
while ( i!=_tempCollections.end() ) { while ( i!=_tempCollections.end() ) {
string ns = *i; string ns = *i;
dblock l; dblock l;
Client::Context ctx( ns ); Client::Context ctx( ns );
if ( nsdetails( ns.c_str() ) && if ( nsdetails( ns.c_str() ) &&
ns.compare( 0, db.length(), db ) == 0 ) { ns.compare( 0, db.length(), db ) == 0 ) {
try { try {
string err; string err;
BSONObjBuilder b; BSONObjBuilder b;
dropCollection( ns, err, b ); dropCollection( ns, err, b );
i = _tempCollections.erase(i); i = _tempCollections.erase(i);
++i; if ( i!=_tempCollections.end() )
} ++i;
catch ( ... ){ }
log() << "error dropping temp collection: " << ns << endl; catch ( ... ){
} log() << "error dropping temp collection: " << ns << endl;
} else { }
++i; } else {
} ++i;
} }
}
} }
void Client::dropAllTempCollectionsInDB(const string db) { void Client::dropAllTempCollectionsInDB(const string db) {
for ( set<Client*>::iterator i = clients.begin(); i!=clients.end(); i++ ){ for ( set<Client*>::iterator i = clients.begin(); i!=clients.end(); i++ ){
Client* cli = *i; Client* cli = *i;
cli->dropTempCollectionsInDB(db); cli->dropTempCollectionsInDB(db);
} }
} }
bool Client::shutdown(){ bool Client::shutdown(){