Skip to content

Commit

Permalink
Remove unused config options
Browse files Browse the repository at this point in the history
  • Loading branch information
bennybp committed May 6, 2024
1 parent 1f89f6e commit 0007c71
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
1 change: 0 additions & 1 deletion docs/source/user_guide/connecting_qcportal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ the server administrator wishes to include.
'get_managers': 1000,
'manager_tasks_claim': 200,
'manager_tasks_return': 10,
'get_server_stats': 25,
'get_access_logs': 1000,
'get_error_logs': 100,
'get_internal_jobs': 1000},
Expand Down
2 changes: 0 additions & 2 deletions qcarchivetesting/qcarchivetesting/testing_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ def __init__(
"get_dataset_entries": 5,
"get_molecules": 11,
"get_managers": 10,
"get_server_stats": 10,
"get_error_logs": 10,
"get_access_logs": 10,
}
Expand All @@ -144,7 +143,6 @@ def __init__(
qcf_config["loglevel"] = "DEBUG"
qcf_config["heartbeat_frequency"] = 3
qcf_config["heartbeat_max_missed"] = 2
qcf_config["statistics_frequency"] = 3

qcf_config["database"] = {"pool_size": 0}
qcf_config["log_access"] = log_access
Expand Down
16 changes: 11 additions & 5 deletions qcfractal/qcfractal/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ class APILimitConfig(ConfigBase):
manager_tasks_claim: int = Field(200, description="Number of tasks a single manager can pull down")
manager_tasks_return: int = Field(10, description="Number of tasks a single manager can return at once")

get_server_stats: int = Field(25, description="Number of server statistics records to return")
get_access_logs: int = Field(1000, description="Number of access log records to return")
get_error_logs: int = Field(100, description="Number of error log records to return")
get_internal_jobs: int = Field(1000, description="Number of internal jobs to return")
Expand Down Expand Up @@ -358,9 +357,6 @@ class FractalConfig(ConfigBase):
)

# Periodics
statistics_frequency: int = Field(
3600, description="The frequency at which to update servre statistics (in seconds)"
)
service_frequency: int = Field(60, description="The frequency at which to update services (in seconds)")
max_active_services: int = Field(20, description="The maximum number of concurrent active services")
heartbeat_frequency: int = Field(
Expand Down Expand Up @@ -406,13 +402,24 @@ class FractalConfig(ConfigBase):

@root_validator(pre=True)
def _root_validator(cls, values):
logger = logging.getLogger("config_validation")

values.setdefault("database", dict())
if "base_folder" not in values["database"]:
values["database"]["base_folder"] = values.get("base_folder")

values.setdefault("api_limits", dict())
values.setdefault("api", dict())
values.setdefault("auto_reset", dict())

if "statistics_frequency" in values:
values.pop("statistics_frequency")
logger.warning("The 'statistics_frequency' setting is no longer and is now ignored")

if "get_server_stats" in values['api_limits']:
values['api_limits'].pop("get_server_stats")
logger.warning("The 'get_server_stats' setting in 'api_limits' is no longer and is now ignored")

return values

@validator("geoip2_dir")
Expand Down Expand Up @@ -558,7 +565,6 @@ def write_initial_configuration(file_path: str, full_config: bool = True):
"logfile": True,
"loglevel": True,
"service_frequency": True,
"statistics_frequency": True,
"max_active_services": True,
"heartbeat_frequency": True,
"database": {"own", "host", "port", "database_name", "base_folder"},
Expand Down

0 comments on commit 0007c71

Please sign in to comment.