return -1;
}
- if ((real_type_pair.second & SYMBOL_TYPE_FINE) && priority == 0) {
- /* Adjust priority for negative weighted symbols */
- priority = 1;
- }
-
std::string static_string_name;
if (name.empty()) {
static_string_name = name;
}
+ if (real_type_pair.first == symcache_item_type::IDEMPOTENT && priority != 0) {
+ msg_warn_cache("priority has been set for idempotent symbol %s: %d",
+ static_string_name.c_str(), priority);
+ }
+
+ if ((real_type_pair.second & SYMBOL_TYPE_FINE) && priority == 0) {
+ /* Adjust priority for negative weighted symbols */
+ priority = 1;
+ }
+
if (items_by_symbol.contains(static_string_name)) {
msg_err_cache("duplicate symbol name: %s", static_string_name.data());
return -1;
}
}
msg_info_config("list of top %d symbols by execution time: %v",
- MIN(tres->nitems, max_displayed_items),
+ (int)MIN(tres->nitems, max_displayed_items),
buf);
g_string_free(buf, TRUE);
name = 'EXPORT_AWS_S3',
type = settings.fail_action and 'postfilter' or 'idempotent',
callback = s3_aws_callback,
- priority = 10,
+ priority = settings.fail_action and 10 or nil,
flags = 'empty,explicit_disable,ignore_passthrough,nostat',
})
\ No newline at end of file
name = 'CLICKHOUSE_COLLECT',
type = 'idempotent',
callback = clickhouse_collect,
- priority = 10,
flags = 'empty,explicit_disable,ignore_passthrough',
augmentations = {string.format("timeout=%f", settings.timeout)},
})
name = 'ELASTIC_COLLECT',
type = 'idempotent',
callback = elastic_collect,
- priority = 10,
flags = 'empty,explicit_disable,ignore_passthrough',
augmentations = {string.format("timeout=%f", settings.timeout)},
})
type = 'postfilter',
callback = greylist_set,
priority = 6,
+ augmentations = {string.format("timeout=%f", redis_params.timeout or 0.0)},
})
local id = rspamd_config:register_symbol({
name = 'GREYLIST_CHECK',
type = 'prefilter',
callback = greylist_check,
priority = 6,
+ augmentations = {string.format("timeout=%f", redis_params.timeout or 0.0)}
})
rspamd_config:register_symbol({
name = settings.symbol,
type = 'idempotent',
callback = history_save,
flags = 'empty,explicit_disable,ignore_passthrough',
- priority = 150,
augmentations = {string.format("timeout=%f", redis_params.timeout or 0.0)}
})
lua_redis.register_prefix(settings.key_prefix .. hostname, N,
name = 'EXPORT_METADATA_' .. k,
type = 'idempotent',
callback = gen_exporter(r),
- priority = 10,
flags = 'empty,explicit_disable,ignore_passthrough',
augmentations = {string.format("timeout=%f", r.timeout or 0.0)}
})
name = 'MILTER_HEADERS',
type = 'idempotent',
callback = milter_headers,
- priority = 10,
flags = 'empty,explicit_disable,ignore_passthrough',
})
name = 'NEURAL_LEARN',
type = 'idempotent,callback',
flags = 'nostat,explicit_disable,ignore_passthrough',
- priority = 5,
callback = ann_push_vector
})
name = 'REPLIES_SET',
type = 'idempotent',
callback = replies_set,
- priority = 5,
group = 'replies',
flags = 'explicit_disable,ignore_passthrough',
})
end,
type = 'idempotent',
flags = 'explicit_disable',
- priority = 10,
}
dofile(rspamd_env.INSTALLROOT .. "/share/rspamd/rules/controller/init.lua")