function _M.init()

in lib/shenyu/register/etcd.lua [355:375]


function _M.init(conf)
    _M.storage = conf.shenyu_storage
    _M.balancer = balancer.new(conf.balancer_type)

    if ngx.worker.id() == 0 then
        _M.shenyu_instances = {}
        _M.etcd_base_url = conf.etcd_base_url

        
        local ok, err = ngx_timer_at(0, watch)
        if not ok then
            log(ERR, "failed to start watch: " .. err)
        end
        return
    end

    local ok, err = ngx_timer_at(2, sync)
    if not ok then
        log(ERR, "failed to start sync ", err)
    end
end