Skip to content

Commit

Permalink
feat: new forced library loading
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Oct 4, 2022
1 parent 495f07d commit d2bf2f2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/appier/base.py
Expand Up @@ -5256,14 +5256,24 @@ def _apply_config(self):
self.name_i = self.name + "-" + self.instance if self.instance else self.name
self.name = self.name_i

def _update_libraries(self):
def _update_libraries(self, load = False):
"""
Runs the update/flush operation for the libraries meaning
that it will run the various loaders for the libraries that
will populate the key to value association in the libraries
map valuable as debugging information.
:type load: bool
:param load: If a load operation should be performed to try
to retrieve the proper version of the dependency, this is
considered to significantly make the operation more expensive.
"""

if load:
for name in self.lib_loaders:
try: __import__(name)
except Exception: pass

self.libraries = dict()
for name, module in legacy.items(sys.modules):
lib_loader = self.lib_loaders.get(name, None)
Expand Down

0 comments on commit d2bf2f2

Please sign in to comment.