INNER CODE UNIT · Python

allow_custom_cpu

hunvreus/devpush · app/config.py:82

    def allow_custom_cpu(self) -> bool:
        return self.default_cpus is not None and self.max_cpus is not None

    @property
    def allow_custom_memory(self) -> bool:
        return self.default_memory_mb is not None and self.max_memory_mb is not None


@lru_cache
def get_settings():
    settings = Settings()

    # Set URL scheme based on environment
    settings.url_scheme = "http" if settings.env == "development" else "https"

    # CPU default/max normalization
    if settings.default_cpus is not None and settings.default_cpus <= 0:
        logger.warning("DEFAULT_CPUS must be > 0; ignoring and treating as unlimited.")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…