mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 09:06:21 +01:00
only return tail ov raw mongo program output if very long
This commit is contained in:
parent
c49737335d
commit
9eaaef4a6c
@ -197,9 +197,14 @@ namespace mongo {
|
||||
mongoProgramOutput_ << buf.str() << endl;
|
||||
}
|
||||
|
||||
// only returns last 10000 characters
|
||||
BSONObj RawMongoProgramOutput( const BSONObj &args ) {
|
||||
boost::mutex::scoped_lock lk( mongoProgramOutputMutex );
|
||||
return BSON( "" << mongoProgramOutput_.str() );
|
||||
string out = mongoProgramOutput_.str();
|
||||
size_t len = out.length();
|
||||
if ( len > 10000 )
|
||||
out = out.substr( len - 10000, 10000 );
|
||||
return BSON( "" << out );
|
||||
}
|
||||
|
||||
class MongoProgramRunner {
|
||||
|
Loading…
Reference in New Issue
Block a user