Added a shutdown hook so that when the TSDB is shutdown it flushes the cached data to the data store.
timer thread was only running once. Now it runs every minute.