Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

controller: try moving projects from .tmp twice and add more debug ou…

…tput
  • Loading branch information...
commit 80c4b2545f7531f44d23ddaded77724a39cfc9bb 1 parent 0494908
@hbons authored
View
19 SparkleShare/SparkleControllerBase.cs
@@ -455,7 +455,7 @@ private void UpdateState ()
}
- private void ClearFolderAttributes (string path)
+ private void ClearDirectoryAttributes (string path)
{
if (!Directory.Exists (path))
return;
@@ -463,7 +463,7 @@ private void ClearFolderAttributes (string path)
string [] folders = Directory.GetDirectories (path);
foreach (string folder in folders)
- ClearFolderAttributes (folder);
+ ClearDirectoryAttributes (folder);
string [] files = Directory.GetFiles(path);
@@ -652,13 +652,20 @@ public void FinishFetcher ()
string target_folder_path = Path.Combine (this.config.FoldersPath, target_folder_name);
try {
- ClearFolderAttributes (this.fetcher.TargetFolder);
Directory.Move (this.fetcher.TargetFolder, target_folder_path);
} catch (Exception e) {
- SparkleLogger.LogInfo ("Controller", "Error moving directory: " + e.Message);
- this.watcher.EnableRaisingEvents = true;
- return;
+ SparkleLogger.LogInfo ("Controller", "Error moving directory: \"" + e.Message + "\", trying again...");
+
+ try {
+ ClearDirectoryAttributes (this.fetcher.TargetFolder);
+ Directory.Move (this.fetcher.TargetFolder, target_folder_path);
+
+ } catch (Exception x) {
+ SparkleLogger.LogInfo ("Controller", "Error moving directory: " + x.Message);
+ this.watcher.EnableRaisingEvents = true;
+ return;
+ }
}
string backend = SparkleFetcherBase.GetBackend (this.fetcher.RemoteUrl.AbsolutePath);
View
2  SparkleShare/SparkleEventLogController.cs
@@ -241,7 +241,7 @@ public void LinkClicked (string url)
Program.Controller.OpenWebsite (url);
} else if (url.StartsWith ("restore://") && this.restore_revision_info == null) {
- Regex regex = new Regex ("restore://(.+)/([a-f0-9]+)/(.+)/(.{3} [0-9]+ [0-9]+h[0-9]+)/(.+)", RegexOptions.Compiled);
+ Regex regex = new Regex ("restore://(.+)/([a-f0-9]+)/(.+)/(.{3} [0-9]+ [0-9]+h[0-9]+)/(.+)");
Match match = regex.Match (url);
if (match.Success) {
Please sign in to comment.
Something went wrong with that request. Please try again.