Skip to content

custom ConfigSource plugin appears to load configuration twice; any way to disable being used in 'get_mode' call? #2815

Answered by LrWm3
LrWm3 asked this question in Q&A
Discussion options

You must be logged in to vote

Its okay. I added in memory caching to my plugins and have gotten the second execution down to 200ms. I think this will be good enough.

Wanted to have the cache to be static to survive plugin deletion so I used a global decorator. I've included the code snippet below in case someone else has the same issue.

could be improved as a class-level annotation. i also am not sure if it needs to be global or if defining it in aws_secrets_manager_global_cache would work.

def aws_secrets_manager_global_cache(func):
    """
    Hydra calls the ConfigSource plugin multiple times, and 
    creates and deletes the plugins several times as well 
    
    So we need to cache everything to avoid taking a l…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@LrWm3
Comment options

@LrWm3
Comment options

@odelalleau
Comment options

@LrWm3
Comment options

Answer selected by LrWm3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants