Skip to content
Snippets Groups Projects
Commit 9732e624 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

#9 - updated settings structure

parent 07d6408e
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,8 @@
"owncloudPassword": "",
"owncloudDestinationPath": "MyFolder"
},
"cleanup": {
"forceBackupAfterCleanup": true,
"retentionPolicies": [
{
"numberOfMeasurementsPerDay": 24,
......@@ -31,6 +33,7 @@
"ageInDays": 60
}
]
}
},
"api": {
"url": "http://localhost:10003",
......
......@@ -29,13 +29,13 @@ async def databaseInfo(db: Session = Depends(get_database)):
@router.get('/databaseCleanup',
summary='Cleans up the database by enforcing the configured retention policies',
summary='Cleans up the database by enforcing the configured retention policies for each sensor',
response_model=Schemas.DatabaseCleanupInfo,
dependencies=[Depends(check_api_key)])
async def databaseCleanup(db: Session = Depends(get_database)):
infoBefore = DatabaseInfoProvider.get_database_info(db)
retentionPolicies = SETTINGS['database']['retentionPolicies']
retentionPolicies = SETTINGS['database']['cleanup']['retentionPolicies']
policies = []
for item in retentionPolicies:
policies.append(RetentionPolicy(numberOfMeasurementsPerDay=item['numberOfMeasurementsPerDay'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment