mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-26 10:21:51 +00:00
Feat/local packages (#133)
* enable packages to be marked as unavailable locally * change isLocal column to hidden * add option to deprecate a service version based on a min os version
This commit is contained in:
@@ -206,7 +206,7 @@ loadPkgDependencies appConnPool manifest = do
|
||||
time <- liftIO getCurrentTime
|
||||
_ <-
|
||||
runWith appConnPool $
|
||||
insertKey (PkgRecordKey pkgId) (PkgRecord time Nothing) `catch` \(e :: SqlError) ->
|
||||
insertKey (PkgRecordKey pkgId) (PkgRecord False time Nothing) `catch` \(e :: SqlError) ->
|
||||
-- 23505 is "already exists"
|
||||
if sqlState e == "23505" then update (PkgRecordKey pkgId) [PkgRecordUpdatedAt =. Just time] else throwIO e
|
||||
let deps' = first PkgRecordKey <$> HM.toList deps
|
||||
@@ -215,7 +215,7 @@ loadPkgDependencies appConnPool manifest = do
|
||||
( \d -> flip runSqlPool appConnPool $ do
|
||||
_ <-
|
||||
runWith appConnPool $
|
||||
insertKey (fst d) (PkgRecord time Nothing) `catch` \(e :: SqlError) ->
|
||||
insertKey (fst d) (PkgRecord False time Nothing) `catch` \(e :: SqlError) ->
|
||||
-- 23505 is "already exists"
|
||||
if sqlState e == "23505" then update (fst d) [PkgRecordUpdatedAt =. Just time] else throwIO e
|
||||
insertUnique $
|
||||
|
||||
Reference in New Issue
Block a user