Permalink
Browse files

Hack back to live DB in urldammit, in db_cache avoid is not on checki…

…ng for cache instance, as it calls __len__ - explicitly check for None instead
  • Loading branch information...
1 parent 33fbd9a commit 9fc0fef0e9ebd1b85a498ab798d5a9ac4c4c8f2d @harryf committed Feb 16, 2009
Showing with 5 additions and 5 deletions.
  1. +1 −1 dammit/db_cache.py
  2. +4 −4 urldammit.py
View
2 dammit/db_cache.py
@@ -13,7 +13,7 @@
cache_instance = None
def get_cache():
global cache_instance
- if not cache_instance:
+ if cache_instance == None:
cache_instance = cachemanager.new_instance('db')
return cache_instance
View
8 urldammit.py
@@ -41,10 +41,10 @@ def get_instance():
get_known = make_instance_getter('known', lambda: cachemanager.new_instance('known'))
get_unknown = make_instance_getter('unknown', lambda: cachemanager.new_instance('unknown'))
"""
-from dammit.nullcache import NullCache
-get_manager = make_instance_getter('manager', lambda: URIManager(config.get_db_mock()))
-get_known = make_instance_getter('known', lambda: NullCache())
-get_unknown = make_instance_getter('unknown', lambda: NullCache())
+
+get_manager = make_instance_getter('manager', lambda: URIManager(config.get_db()))
+get_known = make_instance_getter('known', lambda: cachemanager.new_instance('known'))
+get_unknown = make_instance_getter('unknown', lambda: cachemanager.new_instance('unknown'))
class urldammit(object):
"""

0 comments on commit 9fc0fef

Please sign in to comment.