AltSysrq / ensync

ENcrypted file SYNChroniser
GNU General Public License v3.0
28 stars 2 forks source link

Automatic reconnection #3

Closed pianohacker closed 7 years ago

pianohacker commented 7 years ago

When running ensync sync --watch on a laptop going in and out of suspend, it would be nice if ensync noticed the dropped connection and automatically reconnected.

It would also be nice if, on top of that, it remembered the key so the passphrase wasn't required on reconnect, but that may be a separate issue.

AltSysrq commented 7 years ago

if ensync noticed the dropped connection

To make sure we're on the same page here, it does exit with a fatal error currently, right?

It would also be nice if, on top of that, it remembered the key so the passphrase wasn't required on reconnect

If it didn't also do this, wouldn't the "automatic reconnect" feature be functionally equivalent to just running ensync inside a while true shell loop / under supervisord?

I do agree this'd be useful though. I had originally decided against it because I didn't think anyone would run ensync in a daemon-like way in conjunction with an interactive means of getting the passphrase, in which case the shell loop / supervisor would have been sufficient.

pianohacker commented 7 years ago

Ah, yes. To clarify; it does notice the dropped connection, but only when it next tries to send a packet, which could be quite awhile after the computer comes back up. Perhaps some kind of heartbeat?

If it didn't also do this, wouldn't the "automatic reconnect" feature be functionally equivalent to just running ensync inside a while true shell loop / under supervisord?

Yup, true. Remembering the passphrase would be the only reason to do this.

AltSysrq commented 7 years ago

Version 0.2.3 fixes the issue where --wait wouldn't notice the connection loss until the next time something woke it up locally. I'll probably get to the other half of this later this week.

AltSysrq commented 7 years ago

Sorry for the exceptionally large value of "week", but this is now in 0.2.4.

pianohacker commented 7 years ago

A quick test shows this working; thanks!