mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
sledgehammer error catch, log and return nothing so that embassy remains live even if registry is unreachable
This commit is contained in:
committed by
Aiden McClelland
parent
408cc45688
commit
d211de9782
@@ -61,7 +61,9 @@ getServerR = handleS9ErrT $ do
|
|||||||
wifi <- WpaSupplicant.runWlan0 $ liftA2 WifiList WpaSupplicant.getCurrentNetwork WpaSupplicant.listNetworks
|
wifi <- WpaSupplicant.runWlan0 $ liftA2 WifiList WpaSupplicant.getCurrentNetwork WpaSupplicant.listNetworks
|
||||||
specs <- getSpecs settings
|
specs <- getSpecs settings
|
||||||
welcomeAck <- fmap isJust . lift . runDB . Persist.get $ WelcomeAckKey agentVersion
|
welcomeAck <- fmap isJust . lift . runDB . Persist.get $ WelcomeAckKey agentVersion
|
||||||
versionLatest <- getOSVersionLatest agentCtx
|
versionLatest <- liftIO $ (try @SomeException $ getOSVersionLatest agentCtx) >>= \case
|
||||||
|
Left e -> (putStrLn @Text $ "Error fetching latest OS Version: " <> show e) $> Nothing
|
||||||
|
Right a -> pure a
|
||||||
|
|
||||||
let sid = T.drop 7 $ specsNetworkId specs
|
let sid = T.drop 7 $ specsNetworkId specs
|
||||||
|
|
||||||
@@ -127,9 +129,7 @@ patchAutoCheckUpdatesR :: Handler ()
|
|||||||
patchAutoCheckUpdatesR = do
|
patchAutoCheckUpdatesR = do
|
||||||
settings <- getsYesod appSettings
|
settings <- getsYesod appSettings
|
||||||
BoolPatchReq val <- requireCheckJsonBody
|
BoolPatchReq val <- requireCheckJsonBody
|
||||||
runM $
|
runM $ injectFilesystemBaseFromContext settings $ if val
|
||||||
injectFilesystemBaseFromContext settings $
|
|
||||||
if val
|
|
||||||
then writeSystemPath autoCheckUpdatesPath ""
|
then writeSystemPath autoCheckUpdatesPath ""
|
||||||
else deleteSystemPath autoCheckUpdatesPath
|
else deleteSystemPath autoCheckUpdatesPath
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user