Let handler cache members from CORE API, for multiple importers

This commit is contained in:
Lance Edgar 2023-06-11 15:26:27 -05:00
parent 2ca9cd8f76
commit 788efbd114

View file

@ -75,6 +75,12 @@ class FromCOREPOSToRattail(importing.ToRattailHandler):
keys.remove('ProductMovement')
return keys
def get_core_members(self, api, progress=None):
if not hasattr(self, 'cached_core_members'):
self.cached_core_members = get_core_members(
self.config, api, progress=progress)
return self.cached_core_members
class FromCOREPOSAPI(importing.Importer):
"""
@ -105,7 +111,7 @@ class FromCOREPOSAPI(importing.Importer):
default=False)
def get_core_members(self):
members = get_core_members(self.config, self.api, progress=self.progress)
members = self.handler.get_core_members(self.api, progress=self.progress)
# maybe ignore NEW MEMBER accounts
if self.should_ignore_new_members():