]> git.ipfire.org Git - people/shoehn/ipfire.org.git/blob - www/webapp/backend/memcached.py
manager: Fix crash is release directory does not exist, yet.
[people/shoehn/ipfire.org.git] / www / webapp / backend / memcached.py
1 #!/usr/bin/python
2
3 import memcache
4
5 from misc import Singleton
6 from settings import Settings
7
8 class Memcached(object):
9 __metaclass__ = Singleton
10
11 def __init__(self):
12 # Fetch hosts from database
13 hosts = Settings().get("memcached_servers").split(",")
14
15 self._connection = memcache.Client(hosts, debug=0)
16
17 def get(self, *args, **kwargs):
18 return self._connection.get(*args, **kwargs)
19
20 def set(self, *args, **kwargs):
21 return self._connection.set(*args, **kwargs)