Merge pull request #4 from mozilla-services/use-persistent-db

Use a persistent sqlite db by default, rather than in-memory one.
This commit is contained in:
Ryan Kelly 2014-03-27 08:59:11 +11:00
commit a6eebee1de
2 changed files with 3 additions and 1 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@ local
\.coverage \.coverage
*~ *~
nosetests.xml nosetests.xml
syncserver.db

View File

@ -24,7 +24,8 @@ def includeme(config):
secret = os.urandom(32).encode("hex") secret = os.urandom(32).encode("hex")
sqluri = settings.get("syncserver.sqluri") sqluri = settings.get("syncserver.sqluri")
if sqluri is None: if sqluri is None:
sqluri = "sqlite:///:memory:" rootdir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
sqluri = "sqlite:///" + os.path.join(rootdir, "syncserver.db")
# Configure app-specific defaults based on top-level configuration. # Configure app-specific defaults based on top-level configuration.
settings.pop("config", None) settings.pop("config", None)