aboutsummaryrefslogtreecommitdiff
path: root/Database/Keys
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-02-12 14:15:28 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-02-12 14:16:35 -0400
commitad1955b4063befa51a36932794f49193a307a23f (patch)
treeeb358ec9eb692f4418f45ee386053e0859a1626e /Database/Keys
parent265cbb0f66881102aa11f73d0cff41c773ddb3a9 (diff)
if keys database cannot be opened due to permissions, ignore
This lets readonly repos be used. If a repo is readonly, we can ignore the keys database, because nothing that we can do will change the state of the repo anyway.
Diffstat (limited to 'Database/Keys')
-rw-r--r--Database/Keys/Handle.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Database/Keys/Handle.hs b/Database/Keys/Handle.hs
index 8a3f2b407..51de58fa8 100644
--- a/Database/Keys/Handle.hs
+++ b/Database/Keys/Handle.hs
@@ -26,8 +26,8 @@ import Prelude
newtype DbHandle = DbHandle (MVar DbState)
-- The database can be closed or open, but it also may have been
--- tried to open (for read) and didn't exist yet.
-data DbState = DbClosed | DbOpen H.DbQueue | DbEmpty
+-- tried to open (for read) and didn't exist yet or is not readable.
+data DbState = DbClosed | DbOpen H.DbQueue | DbUnavailable
newDbHandle :: IO DbHandle
newDbHandle = DbHandle <$> newMVar DbClosed