Skip to content

Commit

Permalink
fixes #129
Browse files Browse the repository at this point in the history
  • Loading branch information
dirtycajunrice committed Apr 29, 2019
1 parent a64d7f0 commit 97c6756
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions varken/dbmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ def __init__(self, server):
self.logger.info("Creating varken database")
self.influx.create_database('varken')

self.logger.info("Creating varken retention policy (30d/1h)")
self.influx.create_retention_policy('varken 30d/1h', '30d', '1', 'varken', False, '1h')
retention_policies = [policy['name'] for policy in self.influx.get_list_retention_policies(database='varken')]

# Fix name bug by adding retention policy retroactively
if 'varken 30d-1h' not in retention_policies:
self.logger.info("Creating varken retention policy (30d-1h)")
self.influx.create_retention_policy('varken 30d-1h', '30d', '1', 'varken', False, '1h')

def write_points(self, data):
d = data
Expand Down

0 comments on commit 97c6756

Please sign in to comment.