summaryrefslogtreecommitdiff
path: root/Assistant/RemoteProblem.hs
blob: c064a9475ba20522947847ed9315070778e57ffb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{- git-annex assistant remote problem handling
 -
 - Copyright 2013 Joey Hess <joey@kitenet.net>
 -
 - Licensed under the GNU GPL version 3 or higher.
 -}

module Assistant.RemoteProblem where

import Assistant.Common
import Utility.TList

import Control.Concurrent.STM

{- Gets all remotes that have problems.
 - Blocks until there is at least one. -}
getRemoteProblems :: Assistant [Remote]
getRemoteProblems = (atomically . getTList) <<~ remoteProblemChan

{- Indicates that there was a problem accessing a remote, and the problem
 - appears to not be a transient (eg network connection) problem. -}
remoteHasProblem :: Remote -> Assistant ()
remoteHasProblem r  = (atomically . flip consTList r) <<~ remoteProblemChan