Commit graph

136 commits

Author SHA1 Message Date
Joey Hess
ab5e409a95 keep track of which remotes have been scanned in process state
Since it turned out to make sense to always scan all remotes on startup,
there's no need to persist the info about which have been scanned.
2012-08-24 15:52:23 -04:00
Joey Hess
a52c552f0b avoid crash when directory doesn't exist 2012-08-24 13:59:24 -04:00
Joey Hess
e58d19b533 run full transfer scan on all remotes at startup
Or when a remote first becomes available after startup.
2012-08-24 13:46:10 -04:00
Joey Hess
72e110ce5d avoid requeueing a download from a remote that no longer has a key 2012-08-24 13:08:38 -04:00
Joey Hess
f3721d89bc also notice dbus unmount events 2012-08-23 18:58:54 -04:00
Joey Hess
4a4f8064ae make the NetWatcher always rescan networked remotes every 30 minutes
There are multiple reasons to do this:

* The local network may be up solid, but a route to a networked remote
  is having trouble. Any transfers to it that fail should be retried.
* Someone might have wicd running, but like to bring up new networks
  by hand too. This way, it'll eventually notice them.
2012-08-23 16:13:43 -04:00
Joey Hess
37b960d3b0 don't rely on hasKeyCheap in the transfer scan
The problem with using it here is that, if a removable drive is scanned
and gets disconnected during the scan, testing for all the files will
indicate it doesn't have them, and the scan is logged as completed
successfully, without necessary transfers being queued.
2012-08-23 15:48:31 -04:00
Joey Hess
715a9a2f8e keep logs of failed transfers, and requeue them when doing a non-full scan
of a remote
2012-08-23 15:24:15 -04:00
Joey Hess
487bdf0e24 add transfer scanned flag files 2012-08-23 13:42:26 -04:00
Joey Hess
546ba8b7e1 better name 2012-08-22 15:37:26 -04:00
Joey Hess
68659f4998 refactor 2012-08-22 14:32:17 -04:00
Joey Hess
5a68acb521 add NetWatcher thread
This deals with interruptions in network connectevity, by listening
for a new network interface coming up (using dbus to see when
network-manager or wicd do it), and forcing a rescan of
2012-08-21 19:58:53 -04:00
Joey Hess
a73e271d60 run resumed transfers immediately, do not wait for free transfer slot
The resumed transfer still uses a slot, so will delay other, queued
transfers from starting.
2012-08-12 12:36:08 -04:00
Joey Hess
b6b8f6da9c implement resuming of paused transfers
Currently waits for a new transfer slot to open up, which probably needs to
change..
2012-08-12 12:11:20 -04:00
Joey Hess
a76078a78e process group killing
This seems to work pretty well.

Handled the process groups like this:

- git-annex processes started by the assistant for transfers are run in their
  own process groups.
- otherwise, rely on the shell to allocate a process group for git-annex

There is potentially a problem if some other program runs git-annex
directly (not using sh -c) The program and git-annex would then be in
the same process group. If that git-annex starts a transfer and it's
canceled, the program would also get killed. May or may not be a desired
result.

Also, the new updateTransferInfo probably closes a race where it was
possible for the thread id to not be recorded in the transfer info, if
the transfer info file from the transfer process is read first.
2012-08-10 15:52:22 -04:00
Joey Hess
d5e06e7b89 fork off git-annex copy for transfers
This doesn't quite work, because canceling a transfer sends a signal
to git-annex, but not to rsync (etc).

Looked at making git-annex run in its own process group, which could then
be killed, and would kill child processes. But, rsync checks if it's
process group is the foreground process group and doesn't show progress if
not, and when git has run git-annex, if git-annex makes a new process
group, that is not the case. Also, if git has run git-annex, ctrl-c
wouldn't be propigated to it if it made a new process group.

So this seems like a blind alley, but recording it here just in case.
2012-08-10 14:14:08 -04:00
Joey Hess
8f1a9ef8b5 added an alert after a file transfer 2012-08-06 17:09:23 -04:00
Joey Hess
5ae1f75a39 handle case of adding populated drive to just created repo
The just created repo has no master branch commits yet. This is now
handled, merging in the master branch from the populated drive.
2012-08-05 16:35:30 -04:00
Joey Hess
34fc0d358e fix crashes when run in a git repo that has been initted but has no master branch yet 2012-08-05 15:53:47 -04:00
Joey Hess
ac71ab7bd7 avoid head 2012-08-05 15:10:26 -04:00
Joey Hess
cb0f435d94 adding removable drive repos now basically works 2012-08-05 14:49:47 -04:00
Joey Hess
3add2cd3ba wire up scan and transfer to newly added removable drive
remote setup still todo
2012-08-04 21:18:57 -04:00
Joey Hess
74fc9fcbe6 add alert when committing 2012-08-02 14:02:35 -04:00
Joey Hess
e21a32627f avoid bogus alert errors 2012-08-02 13:57:34 -04:00
Joey Hess
191ee3b697 awesome alert combining
Now an alert tracks files that have recently been added. As a large file
is added, it will have its own alert, that then combines with the tracker
when dones.

Also used for combining sanity checker alerts, as it could possibly want to
display a lot.
2012-08-02 09:03:04 -04:00
Joey Hess
3695cab949 avoid showing alert when there are no remotes to push to 2012-08-02 09:00:13 -04:00
Joey Hess
9a038b4a9b better ~/ handling 2012-08-02 07:50:13 -04:00
Joey Hess
ffeb060002 don't use hamlet for htmlshim
This allows me to not build-depend on blaze-markup, which was causing
me some trouble when tring to build with cabal on debian. Seems debian
ships Text.Blaze.Renderer.String in two packages.
2012-08-01 21:28:37 -04:00
Joey Hess
ecc168aba3 implemented firstrun repository creation and redirection to full webapp
Some of the trickiest code I've possibly ever written.
2012-08-01 16:10:26 -04:00
Joey Hess
04794eafc0 webapp now starts up when run not in a git repo 2012-07-31 12:17:31 -04:00
Joey Hess
b9b0097876 tweak types so the webapp can run without a threadstate when outside an annex 2012-07-31 11:19:40 -04:00
Joey Hess
2c8bbdf307 made navbar work
also added an About page and a stub Config page.
2012-07-31 02:30:26 -04:00
Joey Hess
58dfa3fa5b split up webapp files 2012-07-31 01:11:32 -04:00
Joey Hess
6e40aed948 fix noscript mode to not allocate notification ids on each refresh
Now the javascript does an ajax call at the start to request the url
to use to poll, and the notification id is generated then, once we know
javascript is working.
2012-07-30 22:24:19 -04:00
Joey Hess
9b1ed7a720 Merge branch 'assistant' into assistant-longpolling-rewrite 2012-07-30 19:40:16 -04:00
Joey Hess
5de897e8d7 remove the "running" alert 2012-07-30 18:26:36 -04:00
Joey Hess
2e54a611c7 Merge branch 'assistant' into assistant-longpolling-rewrite 2012-07-30 18:19:24 -04:00
Joey Hess
254c174bba fix transfers display logic 2012-07-30 18:18:53 -04:00
Joey Hess
502bc5d5f8 rewrote longpolling, trying to avoid duplication
does not work though. stupid JS
2012-07-30 18:01:41 -04:00
Joey Hess
b2e359a15d fix kqueue build 2012-07-30 16:32:32 -04:00
Joey Hess
78b3dada5b better connection close handling
Depending on how the webapp was started up and whether the user clicked on
any links in it, window.close() may be disallowed by browser security
policy. Also if that fails, display a modal dialog that nicely blackens out
the webapp.

TODO: avoid Escape closing it. Bootstrap's docs are unclear about how to do
that.
2012-07-30 14:50:32 -04:00
Joey Hess
a994130843 implement server-side alert closing
Rather than using bootstrap's client-side closing.
Now closed alerts stay closed.
2012-07-30 14:08:22 -04:00
Joey Hess
1f671ee40c spruce up display of the repo list 2012-07-30 13:31:19 -04:00
Joey Hess
8d2667715b prune old filler alerts 2012-07-30 12:21:53 -04:00
Joey Hess
40c9973675 fix push status, broken when inParallel was adapted for -threaded
Before pushing ran in its own process, so exitSuccess was the right thing
to do, but with the threaded code, that's caught as an exception.
2012-07-30 11:52:44 -04:00
Joey Hess
3dce75fb23 make old activiy alerts stay visible
They're updated to show whether the activity succeeded or failed.

This adds several TODOs to the code to fix later.
2012-07-30 02:39:24 -04:00
Joey Hess
ec0493fa4d filter out dead repos from the intro 2012-07-30 00:31:33 -04:00
Joey Hess
895b068e35 tweak intro 2012-07-29 22:11:01 -04:00
Joey Hess
326617ad2f add intro 2012-07-29 21:54:23 -04:00
Joey Hess
0186f06744 tweak Alert closability and construction 2012-07-29 19:41:17 -04:00