Commit 02365b6b authored by Antek Grzanka's avatar Antek Grzanka

Cache?

parent 5ee60c43
......@@ -2,9 +2,11 @@ import uuid
from db import DDBtypes, DDBmeasurements, DDBstations
from functools import partial
import hermes.backend.dict
from tornado.ioloop import IOLoop
cache = hermes.Hermes(hermes.backend.dict.Backend)
class DDBobject(object):
@classmethod
......@@ -66,6 +68,7 @@ class Measurement(DDBobject):
self.value = value
self.time = time
@cache(ttl=6000)
@classmethod
def get(cls, measurement_id):
if cls.stored.get(measurement_id, None):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment