diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-12-31 03:28:12 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-12-31 03:28:12 +0000 |
commit | dae732da66c10976ba37800c0418d0d9acfc4872 (patch) | |
tree | 73138f8928da0259e664c9cbc20ea83eec94c87a | |
parent | 9831d715487760682f6bf127182dd402d346d3ce (diff) | |
download | portage-dae732da66c10976ba37800c0418d0d9acfc4872.tar.gz portage-dae732da66c10976ba37800c0418d0d9acfc4872.tar.bz2 portage-dae732da66c10976ba37800c0418d0d9acfc4872.zip |
For bug #159518, increase the "database is locked" timeout.
svn path=/main/trunk/; revision=5434
-rw-r--r-- | pym/cache/sqlite.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pym/cache/sqlite.py b/pym/cache/sqlite.py index 6b1a3d323..5c1bfa266 100644 --- a/pym/cache/sqlite.py +++ b/pym/cache/sqlite.py @@ -38,6 +38,9 @@ class database(fs_template.FsBased): config.setdefault("autocommit", self.autocommits) config.setdefault("cache_bytes", self.cache_bytes) config.setdefault("synchronous", self.synchronous) + # Timeout for throwing a "database is locked" exception (pysqlite + # default is 5.0 seconds). + config.setdefault("timeout", 15) self._db_init_connection(config) self._db_init_structures() @@ -49,9 +52,12 @@ class database(fs_template.FsBased): self._dbpath = self.location + ".sqlite" #if os.path.exists(self._dbpath): # os.unlink(self._dbpath) + connection_kwargs = {} + connection_kwargs["timeout"] = config["timeout"] try: self._ensure_dirs() - self._db_connection = self._db_module.connect(database=self._dbpath) + self._db_connection = self._db_module.connect( + database=self._dbpath, **connection_kwargs) self._db_cursor = self._db_connection.cursor() self._db_cursor.execute("PRAGMA encoding = %s" % self._db_escape_string("UTF-8")) if not apply_secpass_permissions(self._dbpath, gid=portage_gid, mode=070, mask=02): |