From dd937cdcd3054a255a6dd02d7d8658fd0ffd0f53 Mon Sep 17 00:00:00 2001 From: Griatch Date: Mon, 20 Oct 2014 06:07:15 +0200 Subject: [PATCH] Made new tickerhandler store_key more ubiquitous, in case of not stopping server before pulling latest. --- src/scripts/tickerhandler.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/scripts/tickerhandler.py b/src/scripts/tickerhandler.py index b3b7e61e2f..cf3421a9ba 100644 --- a/src/scripts/tickerhandler.py +++ b/src/scripts/tickerhandler.py @@ -237,9 +237,11 @@ class TickerHandler(object): start_delays = dict((interval, ticker.task.next_call_time()) for interval, ticker in self.ticker_pool.tickers.items()) # update the timers for the tickers - for (obj, interval, idstring), (args, kwargs) in self.ticker_storage.items(): + #for (obj, interval, idstring), (args, kwargs) in self.ticker_storage.items(): + for store_key, (args, kwargs) in self.ticker_storage.items(): + interval = store_key[1] + # this is a mutable, so it's updated in-place in ticker_storage kwargs["_start_delay"] = start_delays.get(interval, None) - ServerConfig.objects.conf(key=self.save_name, value=dbserialize(self.ticker_storage)) else: @@ -256,7 +258,7 @@ class TickerHandler(object): #print "restore:", self.ticker_storage for store_key, (args, kwargs) in self.ticker_storage.items(): if len(store_key) == 2: - # old form of store_key + # old form of store_key - update it store_key = (store_key[0], store_key[1], "") obj, interval, idstring = store_key obj = unpack_dbobj(obj)