mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
changed ExternalLoaderUpdateSettings [#CLICKHOUSE-3305]
This commit is contained in:
parent
10bbf0871b
commit
b66577e38a
@ -7,20 +7,7 @@ namespace DB
|
||||
|
||||
namespace
|
||||
{
|
||||
const ExternalLoaderUpdateSettings & getExternalDictionariesUpdateSettings()
|
||||
{
|
||||
static ExternalLoaderUpdateSettings settings;
|
||||
static std::once_flag flag;
|
||||
|
||||
std::call_once(flag, [] {
|
||||
settings.check_period_sec = 5;
|
||||
settings.backoff_initial_sec = 5;
|
||||
/// 10 minutes
|
||||
settings.backoff_max_sec = 10 * 60;
|
||||
});
|
||||
|
||||
return settings;
|
||||
}
|
||||
const ExternalLoaderUpdateSettings externalDictionariesUpdateSettings;
|
||||
|
||||
const ExternalLoaderConfigSettings & getExternalDictionariesConfigSettings()
|
||||
{
|
||||
@ -41,7 +28,7 @@ namespace
|
||||
|
||||
ExternalDictionaries::ExternalDictionaries(Context & context, bool throw_on_error)
|
||||
: ExternalLoader(context.getConfigRef(),
|
||||
getExternalDictionariesUpdateSettings(),
|
||||
externalDictionariesUpdateSettings,
|
||||
getExternalDictionariesConfigSettings(),
|
||||
&Logger::get("ExternalDictionaries"),
|
||||
"external dictionary"),
|
||||
|
@ -24,6 +24,12 @@ struct ExternalLoaderUpdateSettings
|
||||
UInt64 backoff_initial_sec = 5;
|
||||
/// 10 minutes
|
||||
UInt64 backoff_max_sec = 10 * 60;
|
||||
|
||||
ExternalLoaderUpdateSettings() = default;
|
||||
ExternalLoaderUpdateSettings(UInt64 check_period_sec, UInt64 backoff_initial_sec, UInt64 backoff_max_sec)
|
||||
: check_period_sec(check_period_sec),
|
||||
backoff_initial_sec(backoff_initial_sec),
|
||||
backoff_max_sec(backoff_max_sec) {}
|
||||
};
|
||||
|
||||
|
||||
|
@ -11,41 +11,29 @@ namespace ErrorCodes
|
||||
|
||||
namespace
|
||||
{
|
||||
const ExternalLoaderUpdateSettings & getExternalModelsUpdateSettings()
|
||||
{
|
||||
static ExternalLoaderUpdateSettings settings;
|
||||
static std::once_flag flag;
|
||||
|
||||
std::call_once(flag, [] {
|
||||
settings.check_period_sec = 5;
|
||||
settings.backoff_initial_sec = 5;
|
||||
/// 10 minutes
|
||||
settings.backoff_max_sec = 10 * 60;
|
||||
});
|
||||
const ExternalLoaderUpdateSettings externalModelsUpdateSettings;
|
||||
|
||||
return settings;
|
||||
}
|
||||
const ExternalLoaderConfigSettings & getExternalModelsConfigSettings()
|
||||
{
|
||||
static ExternalLoaderConfigSettings settings;
|
||||
static std::once_flag flag;
|
||||
|
||||
const ExternalLoaderConfigSettings & getExternalModelsConfigSettings()
|
||||
{
|
||||
static ExternalLoaderConfigSettings settings;
|
||||
static std::once_flag flag;
|
||||
std::call_once(flag, [] {
|
||||
settings.external_config = "model";
|
||||
settings.external_name = "name";
|
||||
|
||||
std::call_once(flag, [] {
|
||||
settings.external_config = "model";
|
||||
settings.external_name = "name";
|
||||
settings.path_setting_name = "models_config";
|
||||
});
|
||||
|
||||
settings.path_setting_name = "models_config";
|
||||
});
|
||||
|
||||
return settings;
|
||||
}
|
||||
return settings;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ExternalModels::ExternalModels(Context & context, bool throw_on_error)
|
||||
: ExternalLoader(context.getConfigRef(),
|
||||
getExternalModelsUpdateSettings(),
|
||||
externalModelsUpdateSettings,
|
||||
getExternalModelsConfigSettings(),
|
||||
&Logger::get("ExternalModels"),
|
||||
"external model"),
|
||||
|
Loading…
Reference in New Issue
Block a user