def METHOD_NAME(cls, project, name):
    with metrics.timer("models.environment.get_or_create") as metrics_tags:
        name = cls.get_name_or_default(name)
        cache_key = cls.get_cache_key(project.organization_id, name)
        env = cache.get(cache_key)
        if env is None:
            metrics_tags["cache_hit"] = "false"
            env = cls.objects.METHOD_NAME(name=name, organization_id=project.organization_id)[
                0
            ]
            cache.set(cache_key, env, 3600)
        else:
            metrics_tags["cache_hit"] = "true"
        env.add_project(project)
        return env