summaryrefslogtreecommitdiff
path: root/Assistant/Threads/WebApp.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-28 16:05:34 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-28 16:05:34 -0400
commitc8cd4ec3082ac7dd24c0377d66c95cb05b51f0ba (patch)
treed970ff1097f6bf0b0aa5dd371495a2b0932e08e4 /Assistant/Threads/WebApp.hs
parentfce32440a51e51f53022b4025fa005e52525a100 (diff)
ensure that git-annex branch is pushed after a successful transfer
I now have this topology working: assistant ---> {bare repo, special remote} <--- assistant And, I think, also this one: +----------- bare repo --------+ v v assistant ---> special remote <--- assistant While before with assistant <---> assistant connections, both sides got location info updated after a transfer, in this topology, the bare repo *might* get its location info updated, but the other assistant has no way to know that it did. And a special remote doesn't record location info, so transfers to it won't propigate out location log changes at all. So, for these to work, after a transfer succeeds, the git-annex branch needs to be pushed. This is done by recording a synthetic commit has occurred, which lets the pusher handle pushing out the change (which will include actually committing any still journalled changes to the git-annex branch). Of course, this means rather a lot more syncing action than happened before. At least the pusher bundles together very close together pushes, somewhat. Currently it just waits 2 seconds between each push.
Diffstat (limited to 'Assistant/Threads/WebApp.hs')
-rw-r--r--Assistant/Threads/WebApp.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/Assistant/Threads/WebApp.hs b/Assistant/Threads/WebApp.hs
index 7657fc7b8..6ed827e01 100644
--- a/Assistant/Threads/WebApp.hs
+++ b/Assistant/Threads/WebApp.hs
@@ -33,6 +33,7 @@ import Assistant.ScanRemotes
import Assistant.TransferQueue
import Assistant.TransferSlots
import Assistant.Pushes
+import Assistant.Commits
import Utility.WebApp
import Utility.FileMode
import Utility.TempFile
@@ -57,11 +58,12 @@ webAppThread
-> TransferQueue
-> TransferSlots
-> PushNotifier
+ -> CommitChan
-> UrlRenderer
-> Maybe (IO String)
-> Maybe (Url -> FilePath -> IO ())
-> NamedThread
-webAppThread mst dstatus scanremotes transferqueue transferslots pushnotifier urlrenderer postfirstrun onstartup = thread $ do
+webAppThread mst dstatus scanremotes transferqueue transferslots pushnotifier commitchan urlrenderer postfirstrun onstartup = thread $ do
webapp <- WebApp
<$> pure mst
<*> pure dstatus
@@ -69,6 +71,7 @@ webAppThread mst dstatus scanremotes transferqueue transferslots pushnotifier ur
<*> pure transferqueue
<*> pure transferslots
<*> pure pushnotifier
+ <*> pure commitchan
<*> (pack <$> genRandomToken)
<*> getreldir mst
<*> pure $(embed "static")