if ( cmdObj["j"].trueValue() ) {
|
if( !getDur().awaitCommit() ) {
|
// --journal is off
|
result->append("jnote", "journaling not enabled on this server");
|
// Set the err field, if the result document doesn't already have it set.
|
if ( !err ) {
|
result->append( "err", "nojournal" );
|
}
|
return true;
|
}
|
if( cmdObj["fsync"].trueValue() ) {
|
*errmsg = "fsync and j options cannot be used together";
|
return false;
|
}
|
}
|
else if ( cmdObj["fsync"].trueValue() ) {
|
Timer t;
|
if( !getDur().awaitCommit() ) {
|
// if get here, not running with --journal
|
log() << "fsync from getlasterror" << endl;
|
result->append( "fsyncFiles" , MemoryMappedFile::flushAll( true ) );
|
}
|
else {
|
// this perhaps is temp. how long we wait for the group commit to occur.
|
result->append( "waited", t.millis() );
|
}
|
}
|