From c4c8fbbe4d704a4e1aaf2e09cfd2ac808717c61d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Fri, 5 Apr 2024 13:01:46 +0200 Subject: [PATCH] [docs] Enhance models' docstrings --- argos/server/models.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/argos/server/models.py b/argos/server/models.py index c0c3d01..065fc33 100644 --- a/argos/server/models.py +++ b/argos/server/models.py @@ -1,4 +1,5 @@ """Database models""" + from datetime import datetime, timedelta from typing import List, Literal @@ -87,12 +88,12 @@ class Task(Base): class Result(Base): - """There is multiple results per tasks. + """There are multiple results per task. - The results uses the informations returned by the agents. + The results store information returned by the agents. - The status is "Was the agent able to do the check?" while the severity - depends on the return value of the check. + You can read `status` as "Was the agent able to do the check?" + while the `severity` depends on the return value of the check. """ __tablename__ = "results" @@ -120,14 +121,16 @@ class Result(Base): class ConfigCache(Base): - """Contains some informations on the previous config state + """Database model containing information on the current state + of the configuration. - Used to quickly determine if we need to update the tasks. - There is currently two cached settings: + This is used to determine if tasks are to be updated. + + These settings are cached: - general_frequency: the content of general.frequency setting, in minutes ex: 5 - - websites_hash: the sha256sum of websites setting, to allow a quick - comparison without looping through all websites + - websites_hash: the hash (sha256sum) of websites setting, to allow a quick + comparison without looping through all websites. ex: 8b886e7db7b553fe99f6d5437f31745987e243c77b2109b84cf9a7f8bf7d75b1 """