mononoke: use the background session mode from manual scrub

Summary: There are no users waiting on manual scrub, so set it to use the background session mode.

Reviewed By: krallin

Differential Revision: D23054581

fbshipit-source-id: 985bcadbaf17d2a8c92fdec811ecb239cbca7b37
This commit is contained in:
Alex Hornby 2020-08-12 01:29:33 -07:00 committed by Facebook GitHub Bot
parent d910adeb21
commit e18cf0210f
2 changed files with 9 additions and 1 deletions

View File

@ -63,7 +63,7 @@ fn main(fb: fbinit::FacebookInit) -> Result<()> {
let mysql_options = args::parse_mysql_options(&matches);
let blobstore_options = args::parse_blobstore_options(&matches);
let ctx = CoreContext::new_with_logger(fb, logger.clone());
let ctx = CoreContext::new_bulk_with_logger(fb, logger.clone());
let scrub = async move {
let blobstore = open_blobstore(

View File

@ -32,6 +32,14 @@ impl CoreContext {
session.new_context(logger, ScubaSampleBuilder::with_discard())
}
// Context for bulk processing like scrubbing or bulk backfilling
pub fn new_bulk_with_logger(fb: FacebookInit, logger: Logger) -> Self {
let session = SessionContainer::builder(fb)
.session_class(SessionClass::Background)
.build();
session.new_context(logger, ScubaSampleBuilder::with_discard())
}
pub fn test_mock(fb: FacebookInit) -> Self {
let session = SessionContainer::new_with_defaults(fb);