repo: remove unneeded try/catch block and fix up some logic
This commit is contained in:
parent
c6347b4d78
commit
0839657282
|
@ -111,14 +111,13 @@ namespace SparkleLib {
|
|||
}
|
||||
|
||||
|
||||
private string identifier;
|
||||
protected SparkleConfig local_config;
|
||||
|
||||
|
||||
private string identifier;
|
||||
private SparkleWatcher watcher;
|
||||
private SparkleListenerBase listener;
|
||||
|
||||
private TimeSpan poll_interval = PollInterval.Short;
|
||||
|
||||
private Object change_lock = new Object ();
|
||||
private DateTime last_poll = DateTime.Now;
|
||||
|
||||
private Timers.Timer remote_timer = new Timers.Timer () {
|
||||
|
@ -132,14 +131,11 @@ namespace SparkleLib {
|
|||
}
|
||||
|
||||
private static class PollInterval {
|
||||
public static TimeSpan Short { get { return new TimeSpan (0, 0, 5, 0); }}
|
||||
public static TimeSpan Long { get { return new TimeSpan (0, 0, 15, 0); }}
|
||||
public static readonly TimeSpan Short = new TimeSpan (0, 0, 5, 0);
|
||||
public static readonly TimeSpan Long = new TimeSpan (0, 0, 15, 0);
|
||||
}
|
||||
|
||||
|
||||
protected SparkleConfig local_config;
|
||||
|
||||
|
||||
public SparkleRepoBase (string path, SparkleConfig config)
|
||||
{
|
||||
this.local_config = config;
|
||||
|
@ -275,17 +271,17 @@ namespace SparkleLib {
|
|||
|
||||
private void SyncUpBase ()
|
||||
{
|
||||
try {
|
||||
this.remote_timer.Stop ();
|
||||
|
||||
SparkleHelpers.DebugInfo ("SyncUp", Name + " | Initiated");
|
||||
HasUnsyncedChanges = true;
|
||||
|
||||
this.remote_timer.Stop ();
|
||||
|
||||
if (SyncStatusChanged != null)
|
||||
SyncStatusChanged (SyncStatus.SyncUp);
|
||||
|
||||
|
||||
if (SyncUp ()) {
|
||||
SparkleHelpers.DebugInfo ("SyncUp", Name + " | Done");
|
||||
|
||||
HasUnsyncedChanges = false;
|
||||
|
||||
if (SyncStatusChanged != null)
|
||||
|
@ -295,8 +291,6 @@ namespace SparkleLib {
|
|||
|
||||
} else {
|
||||
SparkleHelpers.DebugInfo ("SyncUp", Name + " | Error");
|
||||
|
||||
HasUnsyncedChanges = true;
|
||||
SyncDownBase ();
|
||||
|
||||
if (ServerOnline && SyncUp ()) {
|
||||
|
@ -315,13 +309,11 @@ namespace SparkleLib {
|
|||
}
|
||||
}
|
||||
|
||||
} finally {
|
||||
this.remote_timer.Start ();
|
||||
|
||||
ProgressPercentage = 0.0;
|
||||
ProgressSpeed = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void SyncDownBase ()
|
||||
|
|
Loading…
Reference in a new issue