diff --git a/icalendar-timeseries-server.json b/icalendar-timeseries-server.json deleted file mode 100644 index 847ee7d..0000000 --- a/icalendar-timeseries-server.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "addr": "127.0.0.1", - "port": 8090, - "start_delta": "-PT3H", - "end_delta": "P60D", - "cache": "PT3M", - "tz": "Europe/Zurich", - "calendars": { - "tlstest": { - "interval": "PT5M", - "url": "https://localhost/private.ics", - "ca": "/home/sebastian/tlstest/ca/ca/ca.crt", - "auth": { - "type": "tls", - "keyfile": "/home/sebastian/tlstest/client/combined.pem" - } - }, - "filetest": { - "interval": "PT1M", - "url": "file:///srv/http/private.ics" - } - }, - "key_replace": { - "summary": "a_summary", - "description": "b_description" - }, - "value_replace": { - "summary": "{{ summary|truncate(100, end=' \\N{HORIZONTAL ELLIPSIS}') }}", - "description": "{{ description|truncate(100, end=' \\N{HORIZONTAL ELLIPSIS}') }}", - "useless_metric": "{{ start.timestamp() + end.timestamp() }}" - } -} diff --git a/icalendar_timeseries_server/config.py b/icalendar_timeseries_server/config.py index 81cc795..c3d18df 100644 --- a/icalendar_timeseries_server/config.py +++ b/icalendar_timeseries_server/config.py @@ -28,7 +28,8 @@ class CalendarConfig: def __init__(self, config: Dict[str, Any], config_path: str) -> None: self._url: str = _keycheck('url', config, str, config_path) - self._scrape_interval: Duration = _parse_timedelta('interval', config, config_path, default_value='PT15M') + self._scrape_interval: Duration = _parse_timedelta('interval', config, config_path, default_value='PT15M', + force_positive=True) self._ca: Optional[str] = _keycheck('ca', config, str, config_path, optional=True) auth: Dict[str, Any] = _keycheck('auth', config, dict, config_path, default_value={'type': 'none'}) self._authtype: str = _keycheck('type', auth, str, f'{config_path}.auth',