Radiator Server Documentation — v10.34.2

@init

A top-level initialization pipeline. Multiple @init{} blocks execute sequentially in configuration order.

Note: The @ prefix is required for pipeline blocks. The legacy syntax without @ (e.g., init {}) is deprecated and emits warnings. Use @init {} for new configurations.

Scope: Variables are isolated to each init block. Configured caches are shared between blocks.

Use Cases

  • Logging initialization events
  • Pre-populating caches
  • Initializing shared resources
  • Running initial health checks

For work that must run on a recurring schedule rather than at configuration load, see Cron and interval timers.

Example: Basic Configuration Logging

@init {
    log "SYSTEM" {
        json {
            "event" "configuration_loaded";
            "timestamp" datetime.timestamp;
        }
    }
}

Example: Multiple Init Blocks

You can define multiple @init{} blocks that execute in sequence:

caches {
    cache "CONFIG_CACHE" {
        timeout 1h;
    }
}

@init {
    # First init block: Set initial cache value
    cache {
        cache "CONFIG_CACHE";
        key "last_reload";
        value datetime.timestamp;
    }

    log "SYSTEM" {
        json {
            "event" "init_started";
            "timestamp" datetime.timestamp;
        }
    }
}

@init {
    # Second init block: Log completion
    # Note: Cache values from the first init block ARE visible here
    log "SYSTEM" {
        json {
            "event" "init_completed";
            "timestamp" datetime.timestamp;
        }
    }
}

Important: Cache Behavior

Initialization does not clear configured caches.

  • Cache values written by one block are available to subsequent blocks.
  • Initialization actions can explicitly replace or remove cached values.

Important: Variable Behavior

Variables are isolated to each init block. This means:

  • Variables set in one @init{} block are NOT visible in subsequent @init{} blocks
  • Each init block starts with empty variables
  • Use cache for sharing data between init blocks

For persistent data storage, use:

  • Database backends (SQLite, MySQL, PostgreSQL)
  • JSONFile backends
  • External HTTP APIs

Execution Context

@init{} pipelines execute without AAA request context:

  • No aaa.* variables are available (no aaa.identity, aaa.result, etc.)
  • Use assignments and log, cache, or backend actions to perform init tasks

See Also