function _M.put()

in lib/skywalking/correlation_context.lua [78:113]


function _M.put(context, key, value)
    
    if not key then
        return
    end

    
    if not value or #value == 0 then
        context[key] = nil
        return
    end

    
    if #value > VALUE_MAX_LENGTH then
        return
    end

    
    if context[key] then
        context[key] = value
        return
    end


    
    local contextLength = 0
    for k,v in pairs(context) do
        contextLength = contextLength + 1
    end
    if contextLength >= ELEMENT_MAX_NUMBER then
        return
    end

    
    context[key] = value
end