Fixed the handling of metrics outside of the retention policy

Change-Id: I9fa9d7cf3093c207e4db29c1468e09146849615e
Story: 2003202
Task: 23358
This commit is contained in:
Martin Chacon Piza 2018-08-27 14:43:23 +02:00
parent 87dcf86016
commit 60bd427fca

@ -55,10 +55,15 @@ class Persister(object):
self._data_points = []
self._consumer.commit()
except Exception:
LOG.exception("Error writing to database: {}"
.format(self._data_points))
raise
except Exception as ex:
if "partial write: points beyond retention policy dropped" in ex.message:
LOG.warning("Some points older than retention policy were dropped")
self._data_points = []
self._consumer.commit()
else:
LOG.exception("Error writing to database: {}"
.format(self._data_points))
raise ex
def run(self):
try: