question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Environment layer

See original GitHub issue

I think the suggestion to add a new data layer has a place.

Case: When initializing a project, you can specify certain parameters in CI/CD and then override them in the database.

Code (link):

# shortcut
@staticmethod
def _get_from_env(name):
    return environ.get(name, None)

# updated method
@classmethod
def get(cls, name, default=None):
    val = cls._get_from_cache(name)
    if val is None:
        val = cls._get_from_database(name)
        if val is None:
            val = cls._get_from_env(name)
            if val is None:
                val = cls._get_from_settings(name)
                if val is None:
                    val = default
    return val

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
InzGIBAcommented, Jun 1, 2022

It would also be interesting to have a solution to switch the priorities of the data sources.

A possible solution is to create a map, in the form of a dictionary that matches keys and functions (values) and cycles to the first find.

Examples:

  1. cache
  2. database
  3. env
  4. settings

  1. cache
  2. database
  3. settings
  4. env

etc…

0reactions
fabiocaccamocommented, Jun 6, 2022

@InzGIBA I’m not convinced about this approach, I would like to keep it very simple as it is now, I will think about this…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Environment Layer 3D Lighting in After Effects - YouTube
In this :60 quick tip, learn how easy it is to beautifully light 3D text with environment layers right inside of After Effects....
Read more >
Using an Environment Layer for Reflections in After Effects
To do this, we're going to import some footage and set it to be the environment that the object exists in. Using an...
Read more >
Layers of the atmosphere - NIWA
The atmosphere is comprised of layers based on temperature. These layers are the troposphere, stratosphere, mesosphere and thermosphere.
Read more >
Using an environment layer for reflections - LinkedIn
One way is to use an environment layer to create reflections. Author Richard Harrington demonstrates how to use an environment layer in After...
Read more >
Environmental Layer - Amazon Web Services (AWS)
The Environmental Layer is dedicated to environmental considerations from site selection and construction to operations and sustainability.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found