'Save ticker_storage as a serialized string into a temporary
ServerConf field. Whereas saving is done on the fly, if called
by server when it shuts down, the current timer of each ticker
will be saved so it can start over from that point.'

def save(self):

    if self.ticker_storage:
        start_delays = dict(((interval, ticker.task.next_call_time()) for (interval, ticker) in self.ticker_pool.tickers.items()))
        to_save = {store_key: (args, kwargs) for (store_key, (args, kwargs)) in self.ticker_storage.items() if ((store_key[1] and (('_obj' in kwargs) and kwargs['_obj'].pk) and hasattr(kwargs['_obj'], store_key[1])) or store_key[2])}
        for (store_key, (args, kwargs)) in to_save.items():
            interval = store_key[1]
            kwargs['_start_delay'] = start_delays.get(interval, None)
        ServerConfig.objects.conf(key=self.save_name, value=dbserialize(to_save))
    else:
        ServerConfig.objects.conf(key=self.save_name, delete=True)
