moved code out of webapp
No code changes, aside from some changes to lifting in code that turned out to be able to run in Assistant rather than Handler.
This commit is contained in:
parent
bcd77e65c2
commit
a1b1b5ef52
13 changed files with 327 additions and 309 deletions
|
@ -13,8 +13,8 @@ import Assistant.WebApp.Common
|
|||
import Config.Files
|
||||
import Utility.LogFile
|
||||
import Assistant.DaemonStatus
|
||||
import Assistant.WebApp.Utility
|
||||
import Assistant.Alert
|
||||
import Assistant.TransferSlots
|
||||
|
||||
import Control.Concurrent
|
||||
import System.Posix (getProcessID, signalProcess, sigTERM)
|
||||
|
@ -26,16 +26,16 @@ getShutdownR = page "Shutdown" Nothing $
|
|||
|
||||
getShutdownConfirmedR :: Handler Html
|
||||
getShutdownConfirmedR = do
|
||||
{- Remove all alerts for currently running activities. -}
|
||||
liftAssistant $ do
|
||||
{- Remove all alerts for currently running activities. -}
|
||||
updateAlertMap $ M.filter $ \a -> alertClass a /= Activity
|
||||
void $ addAlert shutdownAlert
|
||||
{- Stop transfers the assistant is running,
|
||||
- otherwise they would continue past shutdown.
|
||||
- Pausing transfers prevents more being started up (and stops
|
||||
- the transfer processes). -}
|
||||
ts <- liftAssistant $ M.keys . currentTransfers <$> getDaemonStatus
|
||||
mapM_ pauseTransfer ts
|
||||
{- Stop transfers the assistant is running,
|
||||
- otherwise they would continue past shutdown.
|
||||
- Pausing transfers prevents more being started up (and stops
|
||||
- the transfer processes). -}
|
||||
ts <- M.keys . currentTransfers <$> getDaemonStatus
|
||||
mapM_ pauseTransfer ts
|
||||
page "Shutdown" Nothing $ do
|
||||
{- Wait 2 seconds before shutting down, to give the web
|
||||
- page time to load in the browser. -}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue