2323import pymongo
2424from bson .son import SON
2525from fs .osfs import OSFS
26- from mongodb_proxy import autoretry_read
2726from opaque_keys .edx .keys import CourseKey , UsageKey
2827from opaque_keys .edx .locator import BlockUsageLocator , CourseLocator , LibraryLocator
2928from path import Path as path
@@ -85,6 +84,7 @@ class MongoKeyValueStore(InheritanceKeyValueStore):
8584 A KeyValueStore that maps keyed data access to one of the 3 data areas
8685 known to the MongoModuleStore (data, children, and metadata)
8786 """
87+
8888 def __init__ (self , data , metadata ):
8989 super ().__init__ ()
9090 if not isinstance (data , dict ):
@@ -465,7 +465,6 @@ def __init__(self, contentstore, doc_store_config, fs_root, render_template,
465465 fs_service = None ,
466466 user_service = None ,
467467 signal_handler = None ,
468- retry_wait_time = 0.1 ,
469468 ** kwargs ):
470469 """
471470 :param doc_store_config: must have a host, db, and collection entries. Other common entries: port, tz_aware.
@@ -474,7 +473,6 @@ def __init__(self, contentstore, doc_store_config, fs_root, render_template,
474473 super ().__init__ (contentstore = contentstore , ** kwargs )
475474
476475 self .doc_store_config = doc_store_config
477- self .retry_wait_time = retry_wait_time
478476 self .do_connection (** self .doc_store_config )
479477
480478 if default_class is not None :
@@ -534,7 +532,7 @@ def do_connection(
534532 self .database = connect_to_mongodb (
535533 db , host ,
536534 port = port , tz_aware = tz_aware , user = user , password = password ,
537- retry_wait_time = self . retry_wait_time , ** kwargs
535+ ** kwargs
538536 )
539537
540538 self .collection = self .database [collection ]
@@ -569,7 +567,7 @@ def _drop_database(self, database=True, collections=True, connections=True):
569567 connection = self .collection .database .client
570568
571569 if database :
572- connection .drop_database (self .collection .database . proxied_object )
570+ connection .drop_database (self .collection .database )
573571 elif collections :
574572 self .collection .drop ()
575573 else :
@@ -578,7 +576,6 @@ def _drop_database(self, database=True, collections=True, connections=True):
578576 if connections :
579577 connection .close ()
580578
581- @autoretry_read ()
582579 def fill_in_run (self , course_key ):
583580 """
584581 In mongo some course_keys are used without runs. This helper function returns
@@ -737,7 +734,6 @@ def _load_items(self, course_key, items, using_descriptor_system=None, for_paren
737734 for item in items
738735 ]
739736
740- @autoretry_read ()
741737 def get_course_summaries (self , ** kwargs ):
742738 """
743739 Returns a list of `CourseSummary`. This accepts an optional parameter of 'org' which
@@ -786,7 +782,6 @@ def extract_course_summary(course):
786782
787783 return courses_summaries
788784
789- @autoretry_read ()
790785 def get_courses (self , ** kwargs ):
791786 '''
792787 Returns a list of course descriptors. This accepts an optional parameter of 'org' which
@@ -821,7 +816,6 @@ def get_courses(self, **kwargs):
821816 )
822817 return [course for course in base_list if not isinstance (course , ErrorBlock )]
823818
824- @autoretry_read ()
825819 def _find_one (self , location ):
826820 '''Look for a given location in the collection. If the item is not present, raise
827821 ItemNotFoundError.
@@ -867,7 +861,6 @@ def get_course(self, course_key, **kwargs): # lint-amnesty, pylint: disable=arg
867861 except ItemNotFoundError :
868862 return None
869863
870- @autoretry_read ()
871864 def has_course (self , course_key , ignore_case = False , ** kwargs ): # lint-amnesty, pylint: disable=arguments-differ
872865 """
873866 Returns the course_id of the course if it was found, else None
@@ -962,7 +955,6 @@ def _id_dict_to_son(id_dict):
962955 for key in ('tag' , 'org' , 'course' , 'category' , 'name' , 'revision' )
963956 ])
964957
965- @autoretry_read ()
966958 def get_items ( # lint-amnesty, pylint: disable=arguments-differ
967959 self ,
968960 course_id ,
0 commit comments