diff --git a/client/asink.go b/client/asink.go index 74fa351..b01b191 100644 --- a/client/asink.go +++ b/client/asink.go @@ -164,6 +164,7 @@ func ProcessLocalEvent(globals AsinkGlobals, event *asink.Event) { } func ProcessRemoteEvent(globals AsinkGlobals, event *asink.Event) { + //TODO check to see if event originated locally. If it did, stop processing it. //Download event if event.IsUpdate() { outfile, err := ioutil.TempFile(globals.tmpDir, "asink") diff --git a/events.go b/events.go index 98c6e27..c36f88a 100644 --- a/events.go +++ b/events.go @@ -12,12 +12,17 @@ const ( type EventStatus uint32 const ( + //the state of the event on the local asink instance on which it originated: NOTICED = 1 << iota //watcher.go has been notified that a file changed COPIED_TO_TMP //temporary version saved off HASHED //hash taken of tmp file CACHED //tmp file renamed to its hash UPLOADED //tmp file has been successfully uploaded to storage ON_SERVER //server has been successfully notified of event + //the state of the event on the asink instance notified that it occurred elsewhere + NOTIFIED //we've been told a file has been changed remotely + DOWNLOADED //event has been downloaded and stored in the local file cache + SYNCED //everything has been done to ensure the affected file is up-to-date ) type Event struct {