Commit 8d5ba8d7 authored by Mart Lubbers's avatar Mart Lubbers

cleanup

parent 00928dc2
......@@ -64,7 +64,17 @@ doTasksWithOptions initFun startable world
= destroyIWorld iworld
where
webTasks = [t \\ WebTask t <- toStartable startable]
startupTasks {distributed, sdsPort} = (if distributed [case onStartup (sdsServiceTask sdsPort) of StartupTask t = t;] []) ++ [t \\ StartupTask t <- toStartable startable]
startupTasks {distributed, sdsPort} =
//If distributed, start sds service task
= (if distributed [startTask (sdsServiceTask sdsPort)] [])
[removeOutdatedSessions
//Start all startup tasks
++ [t \\ StartupTask t <- toStartable startable]
startTask t
# (StartupTask t) = onStartup t
= t
hasWebTasks = not (webTasks =: [])
initSymbolsShare False _ iworld = (Ok (), iworld)
......
......@@ -62,10 +62,10 @@ updateClock iworld=:{IWorld|clock,world}
//When we run the built-in HTTP server we need to do active garbage collection of instances that were created for sessions
removeOutdatedSessions :: !*IWorld -> *(!MaybeError TaskException (), !*IWorld)
removeOutdatedSessions iworld=:{IWorld|options}
# (mbIndex,iworld) = read (sdsFocus {InstanceFilter|defaultValue & onlySession=Just True} filteredInstanceIndex) EmptyContext iworld
= case mbIndex of
Ok (ReadingDone index) = checkAll removeIfOutdated index iworld
Error e = (Error e, iworld)
# (mbIndex,iworld) = read (sdsFocus {InstanceFilter|defaultValue & onlySession=Just True} filteredInstanceIndex) EmptyContext iworld
= case mbIndex of
Ok (ReadingDone index) = checkAll removeIfOutdated index iworld
Error e = (Error e, iworld)
where
checkAll f [] iworld = (Ok (),iworld)
checkAll f [x:xs] iworld = case f x iworld of
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment