Skip to content

Instantly share code, notes, and snippets.

@dsyme
Created September 22, 2021 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsyme/2d9e54551db8292cafad43387202d1b8 to your computer and use it in GitHub Desktop.
Save dsyme/2d9e54551db8292cafad43387202d1b8 to your computer and use it in GitHub Desktop.
namespace DesignTime
module ABC =
let checkLocalCache() =
async {
while true do
try
do! Async.Sleep(10min)
let files = ... // get lis of current files in cache
let fileOrder = ... // sort files in last accessed order
let filesToDelete - ... // work out what to delete
// delete the files
with err ->
printfn "unexpected error in background cahce check, continuing: %A" err
}
checkLocalCache() |> Async.Start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment