mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-30 21:00:24 +01:00
BackupToS3
This commit is contained in:
parent
621bbff4bc
commit
e33356107b
@ -6,6 +6,7 @@ module Data.BlobStore
|
|||||||
, storeWrite
|
, storeWrite
|
||||||
, storeRead
|
, storeRead
|
||||||
, storeExists
|
, storeExists
|
||||||
|
, BackupToS3 (..)
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import ClassyPrelude.Yesod
|
import ClassyPrelude.Yesod
|
||||||
@ -97,7 +98,7 @@ cachedS3Store :: (BackupToS3 key, ToPath key)
|
|||||||
cachedS3Store cache bucket prefix = BlobStore
|
cachedS3Store cache bucket prefix = BlobStore
|
||||||
{ storeWrite' = \key ->
|
{ storeWrite' = \key ->
|
||||||
}
|
}
|
||||||
|
-}
|
||||||
|
|
||||||
class BackupToS3 key where
|
class BackupToS3 key where
|
||||||
shouldBackup :: key -> Bool
|
shouldBackup :: key -> Bool
|
||||||
-}
|
|
||||||
|
|||||||
10
Types.hs
10
Types.hs
@ -1,7 +1,7 @@
|
|||||||
module Types where
|
module Types where
|
||||||
|
|
||||||
import ClassyPrelude.Yesod
|
import ClassyPrelude.Yesod
|
||||||
import Data.BlobStore (ToPath (..))
|
import Data.BlobStore (ToPath (..), BackupToS3 (..))
|
||||||
import Text.Blaze (ToMarkup)
|
import Text.Blaze (ToMarkup)
|
||||||
import Database.Persist.Sql (PersistFieldSql (sqlType))
|
import Database.Persist.Sql (PersistFieldSql (sqlType))
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
@ -70,6 +70,14 @@ instance ToPath StoreKey where
|
|||||||
, toPathPiece viewName
|
, toPathPiece viewName
|
||||||
, "00-index.tar.gz"
|
, "00-index.tar.gz"
|
||||||
]
|
]
|
||||||
|
instance BackupToS3 StoreKey where
|
||||||
|
shouldBackup HackageCabal{} = False
|
||||||
|
shouldBackup HackageSdist{} = False
|
||||||
|
shouldBackup CabalIndex{} = True
|
||||||
|
shouldBackup CustomSdist{} = True
|
||||||
|
shouldBackup HackageViewCabal{} = False
|
||||||
|
shouldBackup HackageViewSdist{} = False
|
||||||
|
shouldBackup HackageViewIndex{} = False
|
||||||
|
|
||||||
newtype HackageRoot = HackageRoot { unHackageRoot :: Text }
|
newtype HackageRoot = HackageRoot { unHackageRoot :: Text }
|
||||||
deriving (Show, Read, Typeable, Eq, Ord, Hashable, PathPiece, ToMarkup)
|
deriving (Show, Read, Typeable, Eq, Ord, Hashable, PathPiece, ToMarkup)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user