version: '3'

rpc:
  listen: tcp://127.0.0.1:6001

server:
  command: 'php -dopcache.enable_cli=1 -dopcache.validate_timestamps=0 ../../bin/roadrunner-worker.php'

http:
  address: '${ADDRESS:-0.0.0.0}:${PORT:-8080}'
  middleware: ['static']
  static:
    dir: '../../public'
    forbid: ['.php', '.htaccess']
  pool:
    num_workers: ${WEB_WORKER_NUM:-0}
    max_jobs: 250 # Restart worker after processing this amount of requests to mitigate memory leaks

jobs:
  timeout: 300 # 5 minutes
  pool:
    num_workers: ${TASK_WORKER_NUM:-0}
    max_jobs: 250 # Restart worker after processing this amount of jobs to mitigate memory leaks
  consume: ['shlink']
  pipelines:
    shlink:
      driver: memory
      config:
        priority: 10
        prefetch: 10

logs:
  encoding: ${LOGS_FORMAT:-console}
  mode: production
  channels:
    http:
      mode: 'off' # Disable logging as Shlink handles it internally
    server:
      encoding: ${LOGS_FORMAT:-console}
      level: info
    jobs:
      encoding: ${LOGS_FORMAT:-console}
      level: debug
